Drawing 8bit bitmap using GUI_DrawBitmap() seems NG

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

    • Drawing 8bit bitmap using GUI_DrawBitmap() seems NG

      Hi,

      These days I try to draw custom 8-bit bitmap with alpha using GUI_DrawBitmap(), but it seems NG.

      The image (with alpha) is some like:

      overlay_image_status_26x26.bmp

      To save ROM space, i index the pixel data to 8-bit c file from the one converted by BmpCvt.exe, with the settings:

      C Source Code

      1. static GUI_CONST_STORAGE GUI_LOGPALETTE _Paloverlay_image_status_26x26x8 = {
      2. 232, // Number of entries
      3. 1, // Has transparency
      4. &_Colorsoverlay_image_status_26x26x8[0]
      5. };
      6. GUI_CONST_STORAGE GUI_BITMAP bmoverlay_image_status_26x26x8 = {
      7. 26, // xSize
      8. 26, // ySize
      9. 26, // BytesPerLine
      10. 8, // BitsPerPixel
      11. _acoverlay_image_status_26x26x8, // Pointer to picture data
      12. &_Paloverlay_image_status_26x26x8, // Pointer to palette
      13. };
      Display All
      Also, I attached the file as "overlay_image_status_26x26x8.zip".

      Then I draw it using the code:


      Source Code

      1. GUI_SetClipRect(&DrawRect);
      2. GUI_DrawBitmap(pBitmap, LeftRect.x0, LeftRect.y0);
      3. GUI_SetClipRect(NULL);


      The screenshot:

      IMG0037X.BMP

      It seems just a bit "dirty".

      So, what's wrong?
      Am I doing something wrong?
      My emWin version is v5.48j.

      Regards,
      Kenmux
      Files
    • Hi,

      I guess the original image contains semi transparency at the edges of the drawing. Please, note that the 8bit bitmaps do not support semi transparency. Either transparent or opaque. You should remove any semi transparency before converting the images (e.g. with GIMP).

      Regards,
      Sven
      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.