Way to suspend paints?

Is there a way to suspend paints?

I am trying to create an “opening drawer” type animation where when you push a button on a form, the form expands like an opening drawer. I’ve confirmed that just redrawing the form multiple times from a timer is too slow. However, I can capture the expanded form as an image and then draw portions of this image from a timer and it looks good.

To capture the expanded form image I have to resize it, arrange the components, etc and then call createComponentSnapshot(). But when I do this, you see the form being resized and I can’t find any way to temporarily suspend paints to the screen.

Greg

No, there’s no way to suspend painting… Maybe you could put all your stuff into a subcomponent, then expand that (without expanding its parent window), cache it, then expand the parent? The Component::setBufferedToImage method might come in handy too.

Thanks, I’ll give that a try.