This documentation is for the old version. Go to the latest Graphics Mill docs

Bitmap.LoadThumbnail Method (String, Int32, Int32)

Loads the thumbnail from specified file on-the-fly.

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Sub LoadThumbnail ( _
	fileName As String, _
	width As Integer, _
	height As Integer _
)
C#
public void LoadThumbnail(
	string fileName,
	int width,
	int height
)

Parameters

fileName

Type: System.String

Name of the file to load.
width

Type: System.Int32

Width of the thumbnail bounding rectangle. You can pass 0 if you want method to find it automatically (see Remarks section for more details).
height

Type: System.Int32

Height of the thumbnail bounding rectangle. You can pass 0 if you want method to find it automatically (see Remarks section for more details).

Remarks

If multiframe file is loaded, thumbnail for the first frame is taken.

Width and height arguments specify a rectangle to fit the thumbnail in. If you omit one of these arguments (set to 0) it will be calculated automatically to preserve aspect ratio. You cannot specify both arguments to 0 at once.

Examples

Visual Basic
'Resize image proportionally to width not larger then 100
bitmap.LoadThumbnail("c:\Mountain.jpg", 100, 0)

'Resize image proportionally to height not larger then 100
'bitmap.LoadThumbnail("c:\Mountain.jpg", 0, 100)

'Resize image proportionally to fit in rectangle 100x100
'bitmap.LoadThumbnail("c:\Mountain.jpg", 100, 100)
C#
//Resize image proportionally to width not larger then 100
bitmap.LoadThumbnail(@"c:\Mountain.jpg", 100, 0);

//Resize image proportionally to height not larger then 100
//bitmap.LoadThumbnail(@"c:\Mountain.jpg", 0, 100);

//Resize image proportionally to fit in rectangle 100x100
//bitmap.LoadThumbnail(@"c:\Mountain.jpg", 100, 100);

See Also

Reference