emWin drawing .bmp images from external Flash

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

I'm attempting to use the emWin function GUI_BMP_DrawEx() to draw a .bmp image stored in external Flash onto a window. I've also implemented a getData() function as shown in the examples.

   

If I try to draw an image onto the background window using GUI_BMP_DrawEx() everything works as expected. The getData function gets accessed several times and the image is correctly displayed.

   

However, if I try to call the same function from within the WM_PAINT case in a window's callback function, it will go in the getData() function and read the first 54 bytes as expected, but when it goes back in to getData() the second time the Offset is not 54 but rather some random value. The program then continues to use the getData() function to read from flash but the offset value is always different and random. It never returns from GUI_BMP_DrawEx().

   

Strangely, if I call GUI_BMP_DrawEx() from the WM_INIT case, the function will call getData() once and then return immediately. In either case the images do not get displayed.

   

I don't understand this behavior. Any help would be greatly appreciated.

   

Thank you,

0 Likes
1 Reply
PSBU_2325551
Level 4
Level 4
First like received

Hello,

   

You should contact Segger for this query ,as they provide the API's with the Library.

   

You can get help at this link -

   

http://forum.segger.com/index.php?page=Board&boardID=3&s=228587b28eb28bf7f9d7f3f5de488919068f3e48

0 Likes