Export stage as picture within a block (not via GUI)

I want to export the current stage as an picture, i.e. exactly what you get when right-clicking the stage and choosing "pic...". However I want to do this programmatically within a block.

There have been solution for this a couple of years ago, but they don't seem to work any more (they produce JavaScript type errors), e.g. search forum for "Save background as file" (I can't post links here).

Any help would be very much appreciated!

Welcome to Snap! Forums!

This block will do the job, if that's what you mean:


However, this block is only available in dev mode, so you have to shift-click the Snap! Logo on the top-left corner, click "Switch to dev mode", and you will find this block in the Looks category. Make sure to switch back to user mode afterwards!

Alternatively, you can just drag this block from the post and drop it into the editor, and you'll get the block.

Then, there is a library block in some library that will export a costume, but I don't have time to find it. Libraries are found in the file menu.

Drag this block into the snap editor! untitled script pic(30)

Wow, thanks for your help @mobility212 and @sathvikrias. This worked perfectly!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.