GUI_DrawStreamedBitmap

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

    • GUI_DrawStreamedBitmap

      Dear technical support,

      please could you help us with process of creating c file from *.dta file for drawing a png image using GUI_DrawStreamedBitmap function?

      We have a 480x360 RGB LCD display using display driver GUIDRV_LIN_16 and color conversion GUICC_M565. We have one frame buffer with 2Bytes per pixel and another 110 x 1024 bytes assigned to emWin library.

      We would like to create custom graphics mostly from png based objects like buttons, menu items, icons etc. As GUI_DrawBitmap is very slow drawing method, we would like to switch to GUI_DrawStreamedBitmap which seems to be much more faster.

      Now we have problems to generate StreamedBitmam c source files from picture like *.png or *.jpg. We use BmpCvtST.exe to generate *.dta file from *.png and than Bin2C.exe to generate *.c source file from *.dta file. But pictures generated in this way will never show using GUI_DrawStreamedBitmap function.

      When I use *.c picture file from this thread GUI_DrawStreamedBitmapEX() we get SEGGER logo displayed (only problem is, that logo is RED, not BLUE), but we don't have success with any our *.c source file generated with steps described above.

      Please could you help us with generating streamed bitmap source files?

      Thank you,

      Pavel
    • Hi,

      the SEGGER logo you found in the old thread is using the old color format (ABGR instead of ARGB). Therefore red and blue colors are swapped.

      The reason why GUI_DrawStreamedBitmap() is not working is that the routine only works for indexed bitmap streams. You can use GUI_DrawStreamedBitmapAuto() if the format is not known during compile time. If the format is known and you intend to decrease memory footprint, you may pick the routine that has the format of the bitmap in the name.

      All available routines and the formats are listed in the manual under "9.1.5 Drawing streamed bitmaps" in the chapter "2-D Graphic Library".

      Best regards,

      Florian
    • Hello Florian,

      thank you for prompt reply.

      So the question now is, how I prepare indexed bitmap stream from *.png file using software tools provided. Or similarly how the SEGGER logo was created from some picture format to indexed bitmap stream.

      thank you in advance

      Pavel
    • I tried couple of times different steps, but with no luck so far

      1) open *.png picture in BmpCvtST.exe.
      2) Image - convert to - best palette
      3) file save as *.dta
      4) i choose save as "high color (565)"
      5) convert *.dta to *.c using Bin2C.exe

      if you can, could you point me out what I'm doing wrong in *.c file progress?

      Thank you for your assistance

      Pavel
    • I was finally successful when I saved the file in

      4) i choose save as "8 bit per pixel"

      If there is other better way I would like to know about this, otherwise my problem is now solved

      thank you again for great feedback