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_DIALOG 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,
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_DIALOG 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,