Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

GMImage.GetResolutionUnits

Queries which units are used for image resolution.

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

Parameters

Parameter Description Example
ImageRef The image reference number. 1

Result

Returns a number.

Description

Queries which units are used for image resolution.
UndefinedResolution = 0, PixelsPerInchResolution = 1, PixelsPerCentimeterResolution = 2

Examples

Queries the resolution unit and fix it, if not set.

Set Variable [ $res ; Value: MBS("GMImage.GetResolutionUnits"; $BigImageRef) ]
If [ $res = 0 ]
    Set Variable [ $r ; Value: MBS("GMImage.SetResolutionUnits"; $BigImageRef; 1) ]
End If

See also

Example Databases

This function checks for a license.

Created 18th August 2014, last changed 19th January 2026


GMImage.GetRenderingIntent - GMImage.GetScene