Display image from the external memory on BUTTON widget

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

  • Display image from the external memory on BUTTON widget

    Hi all,
    I'm using STemWin5.26 in a project based on my
    own board equipped with the STM32F429I MCU, Serial Flash with SPI interface,
    SDRAM and LCD (RGB565).

    All graphical objects are compressed using BitmapConverter (best palette +
    transparency, saved as RLE8 DTA stream) and stored in the Serial Flash memory
    as raw data.

    I am able to display single images using GUI_DrawStreamedBitmapEx() and GetData function,
    but in my application I want to utilize advantages of BUTTON widget. I'm trying
    to set an image from the Serial Flash memory to the button directly using BUTTON_SetStreamedBitmapEx() -but with no success.

    Is it even possible, or what is the best way in this case?

    Thank you in advance.
    Mira
  • Hi Mira,

    The function BUTTON_SetStreamedBitmapEx() is not intended to be used with images to be drawn from external media. It is only for index based streamed bitmaps without compression available within the addressable memory area (ROM or RAM).

    But it is possible to use a custom callback function for drawing the button. Within that function any image could be used. The sample WIDGET_ButtonRound.c shows how that could work.

    Regards,

    Jörg
    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.