Dear all,
we are trying to implement a simple slide show application where four pictures have to be displayed in a cyclic manner.
We use a window with an IMAGE widget and we set the picture using IMAGE_SetDTA() function.
In the main() function there is the following while(1) loop
Msg.MsgId = WM_USER;
slide_show_counter=0;
Msg.Data.v = slide_show_counter%4;
while(WM_IsVisible(hWin))
{
WM_SendMessage(hWin,&Msg);
slide_show_counter++;
Msg.Data.v = slide_show_counter%4;
GUI_Delay(2000);
}
so each 2 seconds the main() application sends a message to the slideshow window using a WM_USER type of message
and in the callback function of hWin the WM_USER message reception is managed in this way:
switch (pMsg->MsgId) {
...........
case WM_USER:
picture_index = pMsg->Data.v;
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_CALL_ANIM_0);
pData = _GetImageById(picture_id_array[picture_index], &FileSize);
IMAGE_SetDTA(hItem, pData, FileSize);
break;
default:
WM_DefaultProc(pMsg);
break;
}
picture_id_array stores the ids of the four images we need to display in a cyclic manner.
When it is time to update the window the emWin window manager changes the picture accordingly to the new setting.
The mechanism seems to work, there is however a bad side effect: something in the lcd module refresh procedure somehow
interferes with the picture display such that you see a very annoying flash on the screen, as if the emWin library were
not able to perform the needed operations within the lcd refresh cycle and actually what you sometimes see on the screen
is a stripe with the background color.
Can you suggest an idea in order to syncronize the STM32F4 lcd controller and the emWin window manager engine?
Or alternatively can you suggest a different approach in order to implement the slide show?
One more information: the smaller are the pictures and the less is the side effect visible, that is why we think it is
some task in the emWin library that takes too much time to be accomplished
Best regards
Ezio
we are trying to implement a simple slide show application where four pictures have to be displayed in a cyclic manner.
We use a window with an IMAGE widget and we set the picture using IMAGE_SetDTA() function.
In the main() function there is the following while(1) loop
Msg.MsgId = WM_USER;
slide_show_counter=0;
Msg.Data.v = slide_show_counter%4;
while(WM_IsVisible(hWin))
{
WM_SendMessage(hWin,&Msg);
slide_show_counter++;
Msg.Data.v = slide_show_counter%4;
GUI_Delay(2000);
}
so each 2 seconds the main() application sends a message to the slideshow window using a WM_USER type of message
and in the callback function of hWin the WM_USER message reception is managed in this way:
switch (pMsg->MsgId) {
...........
case WM_USER:
picture_index = pMsg->Data.v;
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_CALL_ANIM_0);
pData = _GetImageById(picture_id_array[picture_index], &FileSize);
IMAGE_SetDTA(hItem, pData, FileSize);
break;
default:
WM_DefaultProc(pMsg);
break;
}
picture_id_array stores the ids of the four images we need to display in a cyclic manner.
When it is time to update the window the emWin window manager changes the picture accordingly to the new setting.
The mechanism seems to work, there is however a bad side effect: something in the lcd module refresh procedure somehow
interferes with the picture display such that you see a very annoying flash on the screen, as if the emWin library were
not able to perform the needed operations within the lcd refresh cycle and actually what you sometimes see on the screen
is a stripe with the background color.
Can you suggest an idea in order to syncronize the STM32F4 lcd controller and the emWin window manager engine?
Or alternatively can you suggest a different approach in order to implement the slide show?
One more information: the smaller are the pictures and the less is the side effect visible, that is why we think it is
some task in the emWin library that takes too much time to be accomplished
Best regards
Ezio