Skip to main content
himanshusharma
Associate II
Jun 14, 2017 7:24 AM UTC
Question

stemwin icon bitmap change

Posted on June 14, 2017 at 09:24

I had created a image icon menu and want to change bitmap when some one make a click on any icon.

Which function should i use for this, below is the code for reference.

void vGeneralFunction_StartTest(void){

WM_HWIN       hWin;

MenuFlag = StartTest;

LCD_Clear(LCD_COLOR_WHITE);

hProg = PROGBAR_CreateEx(0, 480, 725+4, 19, WM_HBKWIN, WM_CF_SHOW, PROGBAR_CF_HORIZONTAL, 0);

PROGBAR_SetMinMax(hProg, Min, Max);

PROGBAR_SetBarColor(hProg, 0, GUI_YELLOW);

PROGBAR_SetText(hProg, ' ');

/*

* Create iconview widget

*/

hWin = ICONVIEW_CreateEx(LCD_X_SIZE-350+10, LCD_Y_SIZE-85, 1000, 400, 

WM_HBKWIN, WM_CF_SHOW | GUI_WRAPMODE_NONE, 

ICONVIEW_SF_AUTOSCROLLBAR_V, GUI_ID_ICONVIEW0, 80, 80);

/*

* Add icons to the widget

*/

for (lp=0; lp<GUI_COUNTOF(_aBitmapItemStartMenu); lp++) {

ICONVIEW_AddBitmapItem(hWin, _aBitmapItemStartMenu[lp].pBitmap, _aBitmapItemStartMenu[lp].pText);

 }

ICONVIEW_SetBkColor(hWin, ICONVIEW_CI_SEL, GUI_LIGHTGRAY);

ICONVIEW_SetFont(hWin, &GUI_Font20_ASCII);

ICONVIEW_SetTextColor(hWin, ICONVIEW_CI_SEL, GUI_GRAY);

ICONVIEW_SetTextColor(hWin, ICONVIEW_CI_UNSEL, GUI_GRAY);

WM_HasFocus(hWin);

GUI_Exec();

while (1){

if (ts_event.key_status == touch_key_down){

}

GUI_Delay(5);

}

}

#iconview #stemwin #icon #bitmap-change
This topic has been closed for replies.

2 replies

himanshusharma
Associate II
Jun 17, 2017 8:26 AM UTC
Posted on June 17, 2017 at 10:26

anyone on this??

ST Technical Moderator
Jun 19, 2017 9:38 AM UTC
Posted on June 19, 2017 at 11:38

Hi, 

T

ried calling ICONVIEW_SetBitmapItem() and y

ou should make sure to enable the CRC before calling GUI library, if not STemWin will be not function. This is mentioned in the page 6 of AN4323 : 'The CRC module (in RCC peripheral clock enable register) should be enabled before using the library.' 

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks