Using GUI_DrawStreamedBitmapEx correctly?

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

  • Using GUI_DrawStreamedBitmapEx correctly?

    Hello, sorry if I am making some basic errors, but I'm new to using emWin.


    emWin version I am using is 5.18c.


    I have been using the bitmap converter to convert PNG files into C code which is used by my project using 'GUI_DrawBitmap'.
    This works fine and gives me the transparency I need no problem.

    I am now separating the image data from my source code and placing it onto an SD card, so I am now doing the following:
    1. [align=center][align=left]Using bitmap converter, load the PNG files and save them as 'C Stream' (.dta) files, these goes onto the SD card. I am selecting 'True colour with alpha channel, compressed' here.[/align][/align]
    2. [align=center][align=left]Displaying the image using the GUI_DrawStreamedBitmapEx function. I have created the appropriate GetData function as described on page 175 of the manual.[/align][/align]
    However, nothing gets displayed. I notice that on page 122 of the manual there is a table listing bitmaps formats that are supported, and I am guessing that the stream file will hold an 'RLE32' type. Does this mean I need to call 'GUI_DrawStreamedBitmapRLE32Ex' as this table seems to imply?
    This function doesn't seem to exist in the library.

    Any help would be appreciated,

    Matt Jackson.

    The post was edited 1 time, last by mattjackson ().

  • Hello Matt,

    Please note the description of the function GUI_DrawStreamedBitmapEx(): "This function can be used for drawing index based bitmap data streams..."

    The dta file should hold the format you have specified when saving it. Please choose the drawing function accordingly.

    Best regards,
    Adrian
  • Thank you for your response.

    I thought this might be the case, but I couldn't call any other type of GUI_DrawStreamedBitmapXXX() type function as they didn't appear to be in the library.
    I have since upgraded to 5.24d library version.


    Given that the original stream data contained transparency, I am thinking that I need to use functions that support RLE32 format.
    The table on page 122 of the manual seems to suggest that this format does indeed have an Ex() function available, along the lines of 'GUI_DrawStreamedBitmapRLE32Ex()' but I cannot locate this function?
    If I use the GUI_DrawStreamedBitmapExAuto() function, then the image is drawn correctly, but without any transparency.


    Thanks,
    Matt Jackson.

    The post was edited 4 times, last by mattjackson ().

  • Problem solved! I'm ashamed to say that checking the original image revealed that somehow the alpha layer information had been removed!
    Tried again with the correct image and it's now displayed no problem.

    Adrian, thank you for your time and patience with a newbie !

    Regards,
    Matt.