All functions   Mac OS X   Windows   Crossplatform   Components   New in version: 1.0   1.1   1.2   1.3   1.4   1.5   1.6   1.7   1.8   2.0  

GMImage.Scale

Component: GraphicsMagick
Mac OS X: Works
Windows: Works

MBS( "GMImage.Scale"; ImageRef; Geometry )

Parameters

Parameter Description Example value
ImageRef The image reference (a number returned from the GMImage.New functions) 1
Geometry The rectangle. Geometry is specified as a width and height "100x200". With an optional offset "100x200+10+20". For percent values, add a percent on the end, for % values add a %: "100x200%!" "300x200"

Result

Returns "OK" on success.

Description

Resize image by using simple ratio algorithm.

Examples

Scales the image to 50%

Let ( [
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$Width = MBS("GMImage.GetWidth";$Image);
$Height = MBS("GMImage.GetHeight";$Image);
$Width = $Width/2;
$Height = $Height/2;
$ScaleResult = MBS("GMImage.Scale";$Image; $Width & "x" & $Height);
$Result = MBS("GMImage.WriteToPNGContainer"; $Image);
$Error = MBS("GMImage.Destroy";$Image)
];
$Result)

Feedback: Report problem or ask question.