Hello,
I have a GIF animation which I want to continuously show on a dialog window based on a variable. Currently the animation works but it slows down the system.
I have a function which is called every 25msec in my super loop while(1). In the function I get the Sub image from the GIF image and call WM_InvalidateArea to update only the rectangle area of the GIF image shown. I have other areas too for which I call the same WM_InvalidateArea to be updated based on other variables but this is not frequent and need to be done only on variable change.
When WM_InvalidateArea is called it triggers the PAINT event and on paint I draw the image using GUI_GIF_DrawSub.
So the requirements are,
1) Update GIF area by WM_InvalidateArea called every 25msec. once the variable is set then animation is to be continuously shown until variable gets cleared.
GUI_GIF_DrawSub is called in PAINT to handle above point.
2) Update other area1 by WM_InvalidateArea called on 25msec but WM_InvalidateArea is called only when change in variable. Called only once if change.
DrawOtherArea1() is called in PAINT which calls GUI_Draw_Arc1(), GUI_Draw_Arc2(), GUI_Draw_Arc3() to handle above point.
3) Update other area2 by WM_InvalidateArea called on 25msec but WM_InvalidateArea is called only when change in variable. Called only once if change. MEMDEV is updated here
DrawOtherArea2() is called in PAINT to handle above point.
(This uses GUI_MEMDEV_WriteAt function)
My PAINT function is as below
GUI_SetBkColor(color);
GUI_Clear();
GUI_GIF_DrawSub(...) // Handle point 1 above
DrawOtherArea1(); // Handle point 2 above // GUI_Draw_Arc is called 3 times to draw 3 arcs.
DrawOtherArea2(); // Handle point 3 above // GUI_MEMDEV_WriteAt is called.
This takes up some time due to which the system becomes slow.
I am not sure how to handle all the 3 points at once in PAINT as currently all get drawn.
Even if there are no updates for point 2 and point 3 whether still I have to call DrawOtherArea1() DrawOtherArea2() in PAINT?
Are there any better ways to handle such scenario?
Thanks
Regards,
Anuj
I have a GIF animation which I want to continuously show on a dialog window based on a variable. Currently the animation works but it slows down the system.
I have a function which is called every 25msec in my super loop while(1). In the function I get the Sub image from the GIF image and call WM_InvalidateArea to update only the rectangle area of the GIF image shown. I have other areas too for which I call the same WM_InvalidateArea to be updated based on other variables but this is not frequent and need to be done only on variable change.
When WM_InvalidateArea is called it triggers the PAINT event and on paint I draw the image using GUI_GIF_DrawSub.
So the requirements are,
1) Update GIF area by WM_InvalidateArea called every 25msec. once the variable is set then animation is to be continuously shown until variable gets cleared.
GUI_GIF_DrawSub is called in PAINT to handle above point.
2) Update other area1 by WM_InvalidateArea called on 25msec but WM_InvalidateArea is called only when change in variable. Called only once if change.
DrawOtherArea1() is called in PAINT which calls GUI_Draw_Arc1(), GUI_Draw_Arc2(), GUI_Draw_Arc3() to handle above point.
3) Update other area2 by WM_InvalidateArea called on 25msec but WM_InvalidateArea is called only when change in variable. Called only once if change. MEMDEV is updated here
DrawOtherArea2() is called in PAINT to handle above point.
(This uses GUI_MEMDEV_WriteAt function)
My PAINT function is as below
GUI_SetBkColor(color);
GUI_Clear();
GUI_GIF_DrawSub(...) // Handle point 1 above
DrawOtherArea1(); // Handle point 2 above // GUI_Draw_Arc is called 3 times to draw 3 arcs.
DrawOtherArea2(); // Handle point 3 above // GUI_MEMDEV_WriteAt is called.
This takes up some time due to which the system becomes slow.
I am not sure how to handle all the 3 points at once in PAINT as currently all get drawn.
Even if there are no updates for point 2 and point 3 whether still I have to call DrawOtherArea1() DrawOtherArea2() in PAINT?
Are there any better ways to handle such scenario?
Thanks
Regards,
Anuj
The post was edited 1 time, last by anuj.tanksali ().