Color depth on MemDevs

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

  • Color depth on MemDevs

    Hello,

    I call WM_EnableMemdev when creating a new window where I display some BMPs from an SD card using GUI_BMP_DrawEx().

    On emWin manual it's stated that the Memdev automatically created by the WM "knows" what's the lower color depth needed and thus creates a Memory Device accordingly.

    Thing is, when I display a 24bits color depth BMP the Memory Device is the same size as when I display a 8bit color depth BMP. I guess I'm missing something, how can I "help" emWin understand what's the correct color depth to use in order to not waste RAM?



    Also, does the WM automatically deletes the Memdev and frees the memory that it was using when the printing to the screen is finished?


    Thanks! :)
  • Hello,

    Memory Devices which are created automatically by the Window Manager are set to the color depth of the display. So if emWin is configured to output 32bpp, a Memory Device for a window is created accordingly. Displaying an 8bpp bitmap would not change that.

    Yes, the Window Manager uses Memory Devices automatically. This means Memory Devices are automatically created and deleted.

    Detailed information about the automatic use of Memory Devices can be found in the chapters "The Window Manager" and "Memory Devices".

    Best regards,
    Adrian
  • Hello,

    You would usually do that in the function LCD_X_Config() (LCDConf.c). In order to change the color depth, you will have to change the display driver configuration. For details on how to do that, please refer to the description of the used display driver in the chapter "Display drivers" in the emWin user manual.

    Best regards,
    Adrian