All functions
Mac OS X
Windows
Crossplatform
Server
Components
Guides
Statistic
New in version:
2.0
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
3.0
3.1
3.2
GMImage.Crop
Component: GraphicsMagick
Version: 2.0
Mac OS X: Works
Windows: Works
Server: Works
MBS( "GMImage.Crop"; ImageRef; geometry )
Parameters
| Parameter | Description | Example value |
|---|---|---|
| ImageRef | The image reference (a number returned from the GMImage.New functions) | 1 |
| geometry | The rectangle to crop. 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%!" | "100x200" |
Result
Returns "OK" on success.
Description
Crop image (subregion of original image).Examples
Crops the image:
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.Crop";$Image; $Width & "x" & $Height);
$Result = MBS("GMImage.WriteToPNGContainer"; $Image);
$Error = MBS("GMImage.Destroy";$Image)
];
$Result)
Feedback: Report problem or ask question.
Links
MBS Real Studio Plugins - Förderverein St. Arnulf Nickenich