drawing .bmp images from external Flash

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • drawing .bmp images from external Flash

    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,
  • Hi,

    I have no idea why this should fail.

    Maybe there is something not configured properly. Attached is a sample which should work.

    Regards,
    Sven
    Files
    • DrawBMPEx.zip

      (3.17 kB, downloaded 482 times, last: )
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.