How do I resize an ImageMorph?

Bert Freudenberg bert at impara.de
Sun Nov 27 15:12:06 UTC 2005


Am 27.11.2005 um 13:25 schrieb Marcus Pedersén:

> Hi!
> I have read an image from file but it shows up too large in my World.
>
> My code:
> image := BMPReadWriter formFromFileNamed: file.
> image := image asMorph.
>
> I have tried shrink: by: on the form (nothing happens) and  
> displayScaledOn: on another form (Form new extent: 20 at 20 depth: 32)  
> but that does not give all the colors. I have also tried a couple  
> of other messages without any success.
> So, how do I resize an ImageMorph?

Use a SketchMorph instead:

	SketchMorph fromFile: file

or
	SketchMorph withForm: aForm.

If you just drag-and-drop a picture from your OS into Squeak, you  
will get a SketchMorph, too.
	
- Bert -




More information about the Squeak-dev mailing list