using (jpeg or bmp) background for window or framewin

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

  • using (jpeg or bmp) background for window or framewin

    I need to use a photo (jpg or bmp) as window or framewin's background.
    I tried the following two methods :
    1. i draw photo in callback of window ,

    case WM_PAINT:

    GUI_DrawBitmap(&Jennifer ,0,0);

    2. i use image widget:

    hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);

    pData = _GetImageById(ID_IMAGE_0_IMAGE_0, &FileSize);

    IMAGE_SetJPEG(hItem, pData, FileSize);



    But both methods are very slow . I WORK WITH LPC1788
    IS THERE ANY OTHER WAY?

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

  • Hello Adrian,
    I use the Bitmap Converter to convert my image to a c bitmap or JPG ...
    but the background image is displayed very slowly. I want to speed up the display of the background image.
    I have ​​a main window that used for main page. main window contain several edit ,button, ...
    2 keyboard & Numpad for data entry ...
    i try to set background for my mainpage. but speed of displaying photo is very slow.
    thanks for your answer

    The post was edited 2 times, last by Sefidari ().

  • Hello,

    Please note that displaying a JPEG image includes decompression. In case this process is noticeable on your target hardware, I would recommend converting the JPEG image to the color format which is used by the display driver (e.g. GUICC_565) and store it as a c file bitmap or streamed bitmap.

    Best regards,
    Adrian
  • Sefidari wrote:

    Hello Adrian,
    I use the Bitmap Converter to convert my image to a c bitmap or JPG ...
    but the background image is displayed very slowly. I want to speed up the display of the background image.
    [..]



    Hello,

    Sefidari, I have the same problem: Low GUI_DrawBitmap() performance . Can you tell me if you find a solution, please?

    Adrian, he said he used the GUI_DrawBitmap(), so he used the native format also. He said that even the GUI_DrawBitmap() is very slow, so the poor performance is not due to JPEG decompression...

    Best regards,
    Lorenzo
  • Hello,

    I am afraid I did not pay attention to the c bitmap.

    A significant reason why drawing a c bitmap may take a lot of time is the color format which was used to store it. The best performance can be achieved with a c bitmap of a format which matches the color format used by the emWin display driver. If the color formats do not match the colors need to be converted. Converting colors may slow down the drawing process significantly.

    Best regards,
    Adrian
  • SEGGER - Adrian wrote:

    [..]The best performance can be achieved with a c bitmap of a format which matches the color format used by the emWin display driver. If the color formats do not match the colors need to be converted. Converting colors may slow down the drawing process significantly.


    Dear Adrian,

    thank you for your answer.

    What is the emWin display driver and color conversion which match the "True color 24bpp" Bitmap Converter selection, please?
    As I said in the other thread, the display driver I'm using is GUIDRV_LIN_24 which should match the image format... I tried GUICC_M888 color conversion and GUICC_888 with no speed difference.

    Best regards,

    Lorenzo
  • Hello Lorenzo,

    "True color 24bpp" matches GUICC_888. Since this should not cause any additional CPU load the problem must be hardware related. Did you try to just copy data to the memory area which contains your frame buffer? This should work quite as fast as the bitmap is displayed.

    Best regards,
    Adrian
  • SEGGER - Adrian wrote:

    Hello Lorenzo,

    "True color 24bpp" matches GUICC_888. Since this should not cause any additional CPU load the problem must be hardware related. Did you try to just copy data to the memory area which contains your frame buffer? This should work quite as fast as the bitmap is displayed.

    Best regards,
    Adrian
    Hello Adrian,
    Image copy on the framebuffer is immediate. GUI_Clear() is immediate. Simple BMP drawing function written by myself is much faster than GUI_DrawBitmap().
    Is it possible to use my BMP drawing function only for the full screen background, and using the GUI library for everything else?

    Best regards,

    Lorenzo