Downloading an image

Is there any way I can encode a list containing pen trails so I can use

var ide=this.parentThatIsA(IDE_Morph);
ide.saveFileAs(textContents,'text/png;charset=utf-8', textName);

to download it as an image?
And should I use some other text encoding other that utf-8 for an image?

Thanks!

There's no programmatic way to do it, but if you right-click on the stage, one of the menu choices is "pic" and that'll export a picture of the stage (including any visible sprites, watchers, etc.) to your download folder.

If you want to do it programmatically, read the code that implements that option and stick it in a JSFunction. :slight_smile:

Yes, as Brian has said, we need the JSFunction to do it programmatically. I think you had seen before, attaching that code... so I suggest you don't use "saveFileAs" function, because our code already has "saveCanvasAs" and then, this is directly:

recordingTrails

That's all,

Joan

1 Like

Ok, Thanks!

What do you mean?
Is there a code manual or do you mean search through the javaScript in the inspector?
Thanks!

You can download the code (click on the Snap! logo in Snap! itself) and then edit it at your leisure with Emacs your favorite editor. The closest thing to a code manual would be reading the comments at the beginning of each file, especially morphic.js.

Ok, Thanks.