1 Reply Latest reply on Mar 22, 2017 11:49 PM by asankita4_2325551

    emWin drawing .bmp images from external Flash

    fherrera_1697931

      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,