Hello,
I'm developing an application with an x-y graph using GUI_AA_DrawLine of the single data steps (I need something different than the visual appearance of the GRAPH widget).
I call this function inside the WM_PAINT case of the respective window callback but the desired result is obtained only if I draw also the previous steps of the graph (I use WM_InvalidateWindow when I want to redraw the window).
Here is some code:
Display All
Is there any way to retain the previous steps of the graph without having to redrawing all the steps every time?
I want to plot up to 3 graphs like that on the same window so I need to decrease the drawing operations every time I need to update a graph.
Also any similar examples of continuous line drawing will be highly appreciated!
Thank you!
Mark
I'm developing an application with an x-y graph using GUI_AA_DrawLine of the single data steps (I need something different than the visual appearance of the GRAPH widget).
I call this function inside the WM_PAINT case of the respective window callback but the desired result is obtained only if I draw also the previous steps of the graph (I use WM_InvalidateWindow when I want to redraw the window).
Here is some code:
Source Code
- case WM_PAINT:
- GUI_SetColor(GUI_RED);
- GUI_SetPenSize(2);
- for (ix = 0; ix < point_index; ix++)
- {
- GUI_AA_DrawLine(aRedPoints[ix].x,
- aRedPoints[ix].y,aRedPoints[ix+1].x, aRedPoints[ix+1].y);
- }
- break;
- case WM_TIMER:
- WM_RestartTimer(pMsg->Data.v, 100);
- if (point_index > 48)
- point_index = 0;
- else
- point_index++;
- break;
Is there any way to retain the previous steps of the graph without having to redrawing all the steps every time?
I want to plot up to 3 graphs like that on the same window so I need to decrease the drawing operations every time I need to update a graph.
Also any similar examples of continuous line drawing will be highly appreciated!
Thank you!
Mark