links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
Last updated at 1:50 pm UTC on 29 October 2019
 SketchMorph subclass: #Thumbnail
	instanceVariableNames: 'maximumWidth minimumHeight'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'MorphicExtras-PartsBin'

A morph that serves as a thumbnail of a given form.

Example 0:
 aPoint := 320 @ 230.
 (Thumbnail new maxWidth: aPoint x minHeight: aPoint y)
     makeThumbnailFromForm: aForm

Example 1: Create a thumbnail of the desktop (world PasteUpMorph object):

 ((Thumbnail new maxWidth: 200 minHeight: 120) 
 makeThumbnailFromForm: World imageForm)

Example 2: Create a thumbnail from a Windows BMP bitmap graphics file:

 ((Thumbnail new maxWidth: 240 minHeight: 150) 
 (Form fromBMPFileNamed: 'E:\Paint\bitmaps\Garten.bmp'))

Example 3: Create a thumbnail from a JPG file:

 ((Thumbnail new maxWidth: 400 minHeight: 250) 
 (Form fromFileNamed: 'E:\Paint\scan\Baeume.jpg'))

The message #fromFileNamed: works for BMP and PNG files as well.

Example: How to resize project thumbnail windows


There is also ThumbnailMorph

See also

Scaling images