cancel
Showing results for 
Search instead for 
Did you mean: 

using imageconvert.out to generate image

zouzou96
Associate II

I need to externally generate image for my project. as touchGFX documentation mentioned that I can do that using imageconvert.out. when I followed the instructions of how I should use the engine (https://support.touchgfx.com/docs/development/ui-development/working-with-touchgfx/using-ides-with-touchgfx.). it didn't work as it supposed to be. any ideas of how I should use it properly?  

1 ACCEPTED SOLUTION

Accepted Solutions
GaetanGodart
ST Employee

Oh yes, that must be the problem.

I never put spaces or special characters in file/folder names anymore.

You probably have to remove spaces and special characters.

Gaetan Godart
Software engineer at ST (TouchGFX)

View solution in original post

10 REPLIES 10
GaetanGodart
ST Employee

Hello @zouzou96 and welcome to the community!

 

The link you provide shows where the convertor is located. By just running it with no parameter in the terminal, it shows the help :

GaetanGodart_0-1715686179028.png

I don't think there is documentation about it on our support website, at least I have not seen any, but the help should be enough.

What have you tried and what are you blocking on exactly?

 

Also, in a random project of mine, the Makefile have a "asset" function like so:

_assets_: BitmapDatabase TextKeysAndLanguages

.PHONY: BitmapDatabase TextKeysAndLanguages

BitmapDatabase:
	@$(imageconvert_executable) -r $(asset_images_input) -w $(asset_images_output)

if that helps.

 

Regards,

 

Gaetan Godart
Software engineer at ST (TouchGFX)
zouzou96
Associate II

thanks GaetanGodart for your reply. 
yes it help thanks. 
but i still facing a problem. some of the image i am using are not converted. as i see the problem was the file name. is it possible to know the constraint used by the converter over the name of the file?
thanks in advance.

 

GaetanGodart
ST Employee

That is nice to hear!

 

What are the problematic names?

As far as I know we only support .pgn, .svg and .bmp files.

So if one of your file is a .jpeg for instance, it won't work.

Other than that, I don't think that what is before the extension should matter.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)

As i am testing. with some images that present " " or "+". Conversion failed.

it seem that the converter didn't accept those character presented in the name of the image. 
I respect the format of the image.(.pgn, .svg and .bmp)

Is there any other character that might lead to failure in conversion? 

 

Regards,

GaetanGodart
ST Employee

Oh yes, that must be the problem.

I never put spaces or special characters in file/folder names anymore.

You probably have to remove spaces and special characters.

Gaetan Godart
Software engineer at ST (TouchGFX)
zouzou96
Associate II

Hello again @GaetanGodart

I have successfully implement the converter into my windows application. 

but I need to implement it into my android application. is it possible? 
if yes, please any tips to do it?

Hello @zouzou96 ,

 

From my understanding of OS, an application that works on Windows cannot be run on Android. Applications are OS specific, that's why when you download an application (IDE, video editing software, video game, etc), they ask you for your OS.

So I don't think you can run the converter on Android.

Maybe you can use a virtual machine but I guess you are resource limited.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)
zouzou96
Associate II

thanks @GaetanGodart.
if I want to do the conversion at runtime.

As example: I have PNG or BMP images stored in external storage.

is it possible  to know how the conversion work. Them I implement in my code? therefore  can generate the data need to display image on runtime.

regards,

 

GaetanGodart
ST Employee

Hello @zouzou96 ,

 

If I am not wrong, the converter is used to convert to L8 and to do compression and maybe to turn PNG into bitmap.

Now, if you have a PNG or bitmap generated at runtime (ex : you take a picture) and want to display it, if it is a bitmap you ca just load it to an image widget, a bitmap widget or a dynamic ditmap.

If it is a PNG, you will have to convert it. You can use libpng for that.

 

See this post :touchgfx-loading-png-images-at-run-time 

The git of libpng, free to use (we use it in TouchGFX) : github.com/pnggroup/libpng 

I have also found this old thread but was not able to find the example mentioned : show-png-file-dynamic 

 

I personally don't know how this conversion and I don't know if we can share it but you don't need it to make you want. All you need to do is to fetch your image, then convert it to bmp using the libpng and finally load it to a widget of your choice.

 

Hope this helps.

 

Regards,

Gaetan Godart
Software engineer at ST (TouchGFX)