Last updated at 11:22 pm UTC on 24 August 2016
GIFReadWriter putForm: Display onFileNamed: 'screenshot.GIF'.
PNGReadWriter putForm: Display onFileNamed: 'screenshot.png'.
The GIFReadWriter and PNGReadWriter class can encode and decode images to Squeak's internal Form format.
takes a Form and encodes a GIF or PNG from it.
Why This is Interesting:
The whole Display is just a Form. Actually, it's a DisplayScreen, which is a subclass of Form. You can send the whole thing to GIF, or just a window, or something cool that you draw.
Since version 2.7 there is:
And since version 3.9 you can take "snapshots" of the screen or any morph by shift clicking on the blue viewer halo.
- This gets you a clear screenshot (i.e. the halo handles are removed first).
- The "snapshot" can be resized.
- The "snapshot" thumbnail can be exported (as gif, jpeg, etc.) with the usual export feature via the red halo menu.
- An optional popup feature can be set where clicking on the snapshot will display the full sized morph image until the mouse is released.
To write a picture of a Morph to a file see aMorph imageForm.