How to draw bitmap output argb8888 from rgb888 input?

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

    • How to draw bitmap output argb8888 from rgb888 input?

      Hello, can anyone give example of how to draw bitmap from input RGB888 from memory to output ARGB8888 in some LCD lay?
      I'm using STM32H743I-eval board with another LCD 1024x768. Any graphical figures draws good.
      Is appear any emWin functions or i have to define my custom function for drawing?
      I see some close for my question, and this code seems have to work:

      C Source Code

      1. #define LCD_LAYER0_FRAME_BUFFER ((int)0xD0000000)
      2. #define LCD_LAYER1_FRAME_BUFFER ((int)0xD0400000)
      3. uint8_t *uwInternelBuffer = (uint8_t *)0xD0A00000; // Here is my RGB888 data
      4. static GUI_BITMAP picture;
      5. picture.XSize = 1024;
      6. picture.YSize = 768;
      7. picture.BytesPerLine = 1024 * 3;
      8. picture.BitsPerPixel = 24;
      9. picture.pPal = NULL;
      10. picture.pMethods = GUI_DRAW_BMP8888;
      11. picture.pData = (unsigned char *)uwInternelBuffer;
      Display All
      but i see corrupted picture.
    • Hi,

      Try to use GUI_DRAW_BMP24 instead of GUI_DRAW_BMP8888. GUI_DRAW_BMP8888 is 32bit per pixel and emWin expects one byte for alpha.


      [b][/b]
      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.