Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.3   10.4   10.5   11.0   11.1   11.2   11.3   11.4   11.5   12.0    Statistic    FMM    Blog  


Rotate image by specified number of degrees.

Component Version macOS Windows Linux Server iOS SDK
GraphicsMagick 2.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "GMImage.Rotate"; ImageRef; degrees )   More


Parameter Description Example
ImageRef The image reference number. 1
degrees The angle in degrees. 90


Returns "OK" on success.


Rotate image by specified number of degrees.
Positive angles rotate the image in a clockwise direction while negative angles rotate counter-clockwise.


Rotates image by 90 degree to right

Let (
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$RotateResult = MBS("GMImage.Rotate"; $Image; 90);
$Result = MBS("GMImage.WriteToPNGContainer"; $Image);
$DestroyResult = MBS("GMImage.Release";$Image)

Custom function to rotate image:

MBS_Image_Rotate (Picture; rotation)

Picture: Container 'MyTable::MyField"
rotation: Grad ° - numeric Value, positiv OR negative

Benjamin Fehr, EfficientBizz GmbH

Let (
$Image = MBS("GMImage.NewFromContainer"; Picture);
$RotateResult = MBS("GMImage.Rotate"; $Image; rotation);
$Result = MBS("GMImage.WriteToPNGContainer"; $Image);
$DestroyResult = MBS("GMImage.Release";$Image)


See also

Example Databases

Blog Entries

Created 18th August 2014, last changed 21st December 2018

GMImage.Rollxy - GMImage.Rotating

Feedback: Report problem or ask question.

MBS Xojo tutorial videos

Start Chat