C
cronusf
I have a custom control that does some expensive painting operations
in 3D. When the user drags another window over the control, it gets
real slow because of all the repaints generated. This is because the
3D rendering code is in the OnPaint handler.
So what we'd like to do, is render to an offscreen surface, and just
copy the surface to the client area in situations like the user
dragging a window over the control. However, other things in the
control can cause a repaint where we want to actually redo the
rendering...like if the user rotates the object in 3D. In the mouse
move event, the control is refreshed with the new orientation.
I'm assuming that instead of refreshing the control in these
situations, we should update the offscreen surface and then force a
refresh to copy it from the offscreen surface to the client area. But
I am just wondering if there is another idea, or a strategy built into
the Forms framework for this type of thing.
in 3D. When the user drags another window over the control, it gets
real slow because of all the repaints generated. This is because the
3D rendering code is in the OnPaint handler.
So what we'd like to do, is render to an offscreen surface, and just
copy the surface to the client area in situations like the user
dragging a window over the control. However, other things in the
control can cause a repaint where we want to actually redo the
rendering...like if the user rotates the object in 3D. In the mouse
move event, the control is refreshed with the new orientation.
I'm assuming that instead of refreshing the control in these
situations, we should update the offscreen surface and then force a
refresh to copy it from the offscreen surface to the client area. But
I am just wondering if there is another idea, or a strategy built into
the Forms framework for this type of thing.