I have only just started using this library a few months ago - I started with the older pre 2.0 version that provided direct access to a component’s bufferedImage. I used this bufferedImage to be able to draw directly onto the buffer without triggering an immediate refresh/redraw . Here is the code that breaks under the new 2.0 version:
void MyComponent::MyCreateSnapshot(Image** img, int x, int y, int w, int h)
if(bufferedImage != NULL && w > 0 && h > 0)
if(*img != NULL)
*img = new Image(flags.opaqueFlag ? Image::RGB : Image::ARGB, w, h, true);
imageContext.setOrigin (-x, -y);
imageContext.drawImageAt(bufferedImage, 0, 0);
I’m at a bit of a loss to do the same thing under the new 2.0 version as the bufferedImage has been removed from the base component class. I noticed that a CachedImage class has been added though. Is the CachedImage supposed to serve as a replacement for the bufferedImage?
I’ve experimented with createComponentSnapshot but that triggers a redraw and really breaks a lot of my code.
Is there a simple way to do this? Do I need to override CachedImage with my own use case?