When a new TImage is created it is transparent. After drawing objects to this image I would like to clear them. Note that I need to keep the image transparent as the TImage is being used as an overlay to another image.
Some sort of “clear” function for the TImage would be best. I think I’m missing something simple here, I just could not find any clear function within the TImage menu.
You’re not really meant to draw things on a
TImagecontrol. You’re meant to assign itsPictureproperty and leave it alone. In fact, when you draw on aTImage, you’re either drawing transiently by drawing on itsCanvasproperty, or you’re modifying the underlyingPictureobject by drawing on its canvas.To clear a
TImage, simply unassign thePictureproperty.To draw transient images — something you’ll need to repaint whenever the window gets obscured and revealed — use a
TPaintBox.