How can I prevent TPaintbox graphics from being erased when obscured?
Posted on 2009-04-21
I have a situation where I have a TImage on a work surface. The Timage may be moverd around on the work surface. Over the whole work surface is a TPaintBox upon which the user can draw - both over and around the Timage.
It works well, except that if during the work the user passes another window over top, or drags the work surface partly off screen, the portion of the drawing on the TPaintBox that has been obscured is erased.
I know that I could save the contents of the TPaintBox to a Bitmap and restore it, but unless I do that constantly, how can I make sure that it is saved when needed?
Is there a way to prevent the repaint that is erasing the TPaintBox?