I'm building a component which shows a vertical bar chart, using wxGraphicContext to get a nice antialiasing.
The "draft" works, but it needs some optimization. One of them is to draw the fixed part of the chart (axis, labels, grid, etc) on a bitmap each time the component changes size, and then always using that bitmap as a background and redraw only the bars when needed.
What i don't get is how to use wxGraphicContext to draw on a bitmap.
Could i get a little code showing how to do so?
How to use wxGraphicContext to draw on a wxBitmap?
Re: How to use wxGraphicContext to draw on a wxBitmap?
https://docs.wxwidgets.org/trunk/classw ... 2dc0686e2e
FWIW: When the background has only little content, i don't think this optimization is worth the effort (yet).
FWIW: When the background has only little content, i don't think this optimization is worth the effort (yet).
Use the source, Luke!
Re: How to use wxGraphicContext to draw on a wxBitmap?
Oh... that's the way. Thanks.
Well, the bars needs to be updated the fastest i can, and the program will run on an embedded linux PC, so not a really fast machine: i don't have yet a comparison, but i think that drawing that background (and computing each line and label position) at each refresh takes some relevant time.