Solved
MMoha.3Best answer
Associate III
August 24, 2021
Thank you, so I was able to do the task by using the setBitmaps function. Here's the code I came up with:
if (OSC_Status.Running_Stat == Stopped) { //from pause to play:
OSC_Status.Running_Stat = Running;
RunButton.setBitmaps(touchgfx::Bitmap(BITMAP_DARK_BUTTONS_SQUARE_ICON_BUTTON_ID),
touchgfx::Bitmap(BITMAP_DARK_BUTTONS_SQUARE_ICON_BUTTON_ID),
touchgfx::Bitmap(BITMAP_BLUE_ICONS_PAUSE_32_ID),
touchgfx::Bitmap(BITMAP_BLUE_ICONS_PAUSE_32_ID));
// don't forget to invalidate
} else { //from play to pause
OSC_Status.Running_Stat = Stopped;
RunButton.setBitmaps(touchgfx::Bitmap(BITMAP_DARK_BUTTONS_SQUARE_ICON_BUTTON_ID),
touchgfx::Bitmap(BITMAP_DARK_BUTTONS_SQUARE_ICON_BUTTON_ID),
touchgfx::Bitmap(BITMAP_PLAY_32_ID),
touchgfx::Bitmap(BITMAP_PLAY_32_ID));
// don't forget to invalidate
}also include "BitmapDatabase.hpp".
the bitmap id can be found in the images section of TouchGFX:


