4.4.9 Images

Q How do I save an image file as a constant method?
A Just drop the image file onto the Pharo image, inspect it, and print
self form storeString.

The result will (should) be usable to recreate the image. For example (self here is the ByteString):

(SketchMorph withForm: (Compiler evaluate: self)) openInWorld
Q How do I load an image file?
 (SketchMorph fromFile: 'sq.png') openInWorld
Q How do I refresh a Morph? (i.e., to animate an algorithm)
A Send
self layoutChanged

Does not seem to work ...

User Contributed Notes

riverdusty (19 June 2012, 3:58 am)

No, not SMxSketchMorph (?!?!)...

Replace with ImageMorph.

Tested in Pharo 1.4 and works

renggli (20 December 2011, 10:46 am)

Q: How do I referesh a Morph?

A: aMorph changed

frederic.ferrere (20 April 2011, 9:11 am)

SketchMorph class doesn't exist anymore in Pharo-1.2.1.

Replaced by SMxSketchMorph class i suppose ?

maxleske (9 April 2011, 1:50 pm)

Please check the comment on the last line (copied from the original FAQ).

Add a Note

Licensed under Creative Commons BY-NC-SA | Published using Pier |