Blinking an icon/widget
This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.
-
-
Hello Rich,
You can connect a timer to a window and regularly react to the WM_TIMER message in the according callback function.
Best regards,
Adrian -
Hi Adrian,
Maybe I'm not choosing the best graphics and looking for your input.
If you were to put up 4 icons or equivalent graphics (each about 40x40), what type would you use eg image, iconview, etc
and what functions to execute it (only looking for guidance - you are not commited to anything)
Thanks
RichThe post was edited 1 time, last by rali ().
-
Hello Rich,
I understand you want to achieve the blinking by changing the image. I would recommend using emWin bitmaps (c files) which can be created using the Bitmap Converter. It is up to you if you prefer using the ICONVIEW widget or not. Of course you would use the ICONVIEW API or just call the function GUI_DrawBitmap().
Best regards,
Adrian -
Thanks Adrian,
I have converted a BMP image to a c file and displayed in on my LCD. How do I select which window to display the c file image on?
Thanks
Rich -
Hello Rich,
Drawing operations should be performed only within the callback function of a window. Please find details in the emWin user manual.
Best regards,
Adrian -
Hi Adrian,
I have used the call back function for drawing but it always end up on the desktop. How do I switch between the desktop and any other window for drawings and then back to the desktop if need be ?
Thanks
Rich -
Hello Rich,
Please note that you will have to set the callback function for a certain window by using its handle.
Best regards,
Adrian -
Adrian,
Below is the first part of the callback function where a bitmap converted to a c file is being displayed but end up on the desktop.
call to display bitmap is ' DspWorldIcon(100);//this will draw bitmap icon from c file into the 'TestBuffering' window
If the correct window is already selected by emWin before the callback is called,
Where am I going wrong?
Thanks
Rich
static void _cbDialog(WM_MESSAGE * pMsg) {
const void * pData;
WM_HWIN hItem;
U32 FileSize;
int NCode;
int Id;
// USER START (Optionally insert additional variables)
// USER END
switch (pMsg->MsgId) {
case WM_INIT_DIALOG:
//
// Initialization of 'TestBuffering'
//
hItem = pMsg->hWin;
WINDOW_SetBkColor(hItem, 0x00DEDEA3);
//
// Initialization of 'Image'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_IMAGE_0);
pData = _GetImageById(ID_IMAGE_0_IMAGE_0, &FileSize);
IMAGE_SetBMP(hItem, pData, FileSize);
//
// Initialization of 'Checkbox'
//
hItem = WM_GetDialogItem(pMsg->hWin, ID_CHECKBOX_0);
CHECKBOX_SetText(hItem, "myCk");
CHECKBOX_SetTextColor(hItem, 0x006538AF);
CHECKBOX_SetFont(hItem, GUI_FONT_16_1);
// USER START (Optionally insert additional code for further widget initialization)
DspWorldIcon(100);//this will draw bitmap icon from c file into the 'TestBuffering' window
// USER END
break;
case WM_NOTIFY_PARENT:
.... -
Hello Rich,
I am afraid I just do not understand what you mean with "displayed but end up on the desktop". Please state precisely what happens and what is the problem. Thank you.
Best regards,
Adrian
-
Share
- Facebook 0
- Twitter 0
- Google Plus 0
- Reddit 0