Offscreen drawing of Components?


#1

It feels weird that I don’t know this - but how do I draw a Component offscreen? Essentially some kind of offscreen platform peer window.

Bruce


#2

do you need something like a screenshot or why?

maybe http://rawmaterialsoftware.com/juce/api/classComponent.html#a2c960bd5ec5ac76d18e82b6883096714


#3

That would be the method I would use, but first I need to add the Component to something and make it visible, right?

Bruce


#4

[quote=“Bruce Wheaton”]That would be the method I would use, but first I need to add the Component to something and make it visible, right?

Bruce[/quote]

No. You can put your component on the stack and call createComponentSnapshot()

Image createImage ()
{
  MyComponent c;
  c.setSize (512, 384);
  return c.createComponentSnapshot(c.getLocalBounds ());
}

#5

Neat, thanks.

Bruce