Hello,
I want to control the no of GIF frames displayed on an image widget so have used a callback for the image widget.
I use the IMAGE_SetGIFData(hItem, pData, FileSize) to set the GIF to image widget and use WM_SetCallback(hObj, Image_CallbackFunc) to set a callback to image widget.
The LCD displays blank in this case. When I remove the WM_SetCallback function call then the GIF animation is visible on the LCD. I assume the callback is overwriting the drawing which is done automatically by IMAGE_SetGIFData. So currently I draw a static image in callback function but it is not drawing on LCD.
My callback function is below,
static void Image_CallbackFunc(WM_MESSAGE* pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT:
Image_Draw(pMsg);
break;
default:
IMAGE_Callback(pMsg); // The original callback
break;
}
}
// my callback calls Image_Draw below
static void Image_Draw(WM_MESSAGE* pMsg){
GUI_DrawBitmap(&image1, 50, 260);
}
The above code does not draw anything on the LCD.
Am not sure why this is happening.
Please let me know if this is the right way to use callback with GIF animation on image widget.
Thanks
Regards,
Anuj
I want to control the no of GIF frames displayed on an image widget so have used a callback for the image widget.
I use the IMAGE_SetGIFData(hItem, pData, FileSize) to set the GIF to image widget and use WM_SetCallback(hObj, Image_CallbackFunc) to set a callback to image widget.
The LCD displays blank in this case. When I remove the WM_SetCallback function call then the GIF animation is visible on the LCD. I assume the callback is overwriting the drawing which is done automatically by IMAGE_SetGIFData. So currently I draw a static image in callback function but it is not drawing on LCD.
My callback function is below,
static void Image_CallbackFunc(WM_MESSAGE* pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT:
Image_Draw(pMsg);
break;
default:
IMAGE_Callback(pMsg); // The original callback
break;
}
}
// my callback calls Image_Draw below
static void Image_Draw(WM_MESSAGE* pMsg){
GUI_DrawBitmap(&image1, 50, 260);
}
The above code does not draw anything on the LCD.
Am not sure why this is happening.
Please let me know if this is the right way to use callback with GIF animation on image widget.
Thanks
Regards,
Anuj