links to this page:
Notes on specific classes
Creating a Morph
Classes by category
Swiki Page List
ThumbnailMorph
Last updated at 2:55 pm UTC on 16 January 2006
A ThumbnailMorph is a
FAQ: Difference between SketchMorph and ImageMorph
. It can be created based on another morph or on an external file.
Example 1: Create a thumbnail of the
World
:
((Thumbnail new maxWidth: 200 minHeight: 120)
makeThumbnailFromForm: World imageForm)
openInWorld
Example 2: Create a thumbnail from a Windows BMP bitmap graphics file:
((Thumbnail new maxWidth: 240 minHeight: 150)
makeThumbnailFromForm:
(Form fromBMPFileNamed: 'E:\Paint\bitmaps\Garten.bmp'))
openInWorld
Example 3: Create a thumbnail from a JPG file:
((Thumbnail new maxWidth: 400 minHeight: 250)
makeThumbnailFromForm:
(Form fromFileNamed: 'E:\Paint\scan\Baeume.jpg'))
openInWorld
Actually this works for BMP files as well, so there is no need to use the message #fromBMPFileNamed: .