260 views
in Embedded Wizard Studio by

"I am looking for guidance on how to convert an image to binary and store it in the flash memory. Additionally, I need to retrieve this image in real-time using Embedded Wizard Studio. While I am familiar with using "Externbitmap", I am uncertain about the process of converting the image to binary. Could you please provide some guidance or resources to help me with this?"  With the help of Below link(Example) I have understood how to access an external image but without the initial image display on the EWS screen can we access the external image ?

Working with Embedded Wizard: Displaying dynamically loaded images (embedded-wizard.de)

1 Answer

0 votes
by

Hello HemanthKumar,

your application case includes three tasks (1) access the raw pixel data of an image, (2) convert it in the desired format, PNG, JPG, whatever and (3) store the contents in flash. Concerning the third task, I can't help you. Writing to flash is an aspect which is depending on the used target system. Here I would recommend you to contact the hardware manufacturer. Possibly, you can setup some Flash File System?

Concerning the first task (access the contents of an image), please see the functions EwLockBitmap() and EwUnlockBitmap(). Using the function you obtain access to the memory area containing the pixel data. Now you can implement a loop and iterate through the data, pixel by pixel. Here it is necessary to take in account the color format of the bitmap. This task is very well comparable to the task of loading an Extern Bitmap with content - just in the opposite direction. See once more the section Take in account the color format of the bitmap.

Import aspect: read access to a bitmap is not guaranteed for all target system. Some targets like Open GL ES, does not provide any interface to directly access the pixel data stored in a texture (bitmap) or frame buffer. This is a limitation of the underlying target system. Trying to EwLockBitmap() on such target system for reading operations will fail therefore.

Finally remains the question of the format how the image has to be stored in the flash. If it is sufficient for you, you can store the raw pixel data. In such case you copy the memory area obtained by EwLockBitmap() to the flash area. If you want the image to be stored in a particular format (PNG, JPG,...) I would recommend you to use a third party library like libJPG or libPNG. Embedded Wizard itself does not include any functionality to encode images.

I need to retrieve this image in real-time using Embedded Wizard Studio

It is not clear for me what you mean.

... but without the initial image display on the EWS screen can we access the external image ?

This question/requirement is also not clear for me.

Best regards

Paul Banach

Embedded Wizard Website | Privacy Policy | Imprint

...