Save screnshot with transparency

Hi,

I am using the save() function to take a PNG screenshot of the sketch. Everything works fine axcept that I can't find a way to let this PNG image have transparent regions. Any pixels that haven't been painted will be exported as opaque gray (RGB 204, 204, 204) --actually just as they are shown in the sketch window.

Is there a way to achieve this?

Answers

  • By definition, main canvas is never transparent!
    I suggest that you draw everything in a PGraphics w/ clear().

  • As said: instead of drawing on the main sketch area, which isn't transparent (otherwise, you would see the desktop on the undrawn parts; you can do that, but that's another story), you can draw on an off-line PGraphics, which is transparent by default.

Sign In or Register to comment.