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:
12.2
12.3
12.4
12.5
13.0
13.1
13.2
13.3
13.4
13.5
Statistic
FMM
Blog
Sets which units are used for image resolution.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 2.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
ImageRef | The image reference number. | 1 |
ResolutionType | UndefinedResolution = 0, PixelsPerInchResolution = 1, PixelsPerCentimeterResolution = 2 | 1 |
Returns "OK" on success.
Convert and Scale:
# Load image from container
Set Variable [ $image ; Value: MBS( "GMImage.NewFromContainer"; SVG to PNG::InputFile ) ]
Set Variable [ $name ; Value: MBS( "Files.FileName"; LiesAlsText(SVG to PNG::InputFile) ) ]
# Scale if parameters are filled in fields
If [ IsEmpty ( SVG to PNG::Target Width in Pixel ) ]
If [ IsEmpty ( SVG to PNG::Target Height in Pixel ) ]
# both empty, do nothing
Else
Set Variable [ $r ; Value: MBS( "GMImage.Scale"; $image; "99999x" & SVG to PNG::Target Height in Pixel & ">") ]
End If
Else
If [ IsEmpty ( SVG to PNG::Target Height in Pixel ) ]
Set Variable [ $r ; Value: MBS( "GMImage.Scale"; $image; SVG to PNG::Target Width in Pixel& ">" ) ]
Else
Set Variable [ $r ; Value: MBS( "GMImage.Scale"; // function $image; // pass in picture SVG to PNG::Target Width in Pixel & // width "x" & // by SVG to PNG::Target Height in Pixel & // height ">" // scale only if it will get smaller ) ]
End If
End If
# If a resolution is defined, put it in
Wenn [ NOT IsEmpty ( SVG to PNG::Resolution in DPI ) ]
Set Variable [ $r ; Value: MBS( "GMImage.SetResolutionUnits"; $image; 1 /* pixel per inch */ ) ]
Set Variable [ $r ; Value: MBS( "GMImage.SetDensity"; $image; SVG to PNG::Resolution in DPI & "x" & SVG to PNG::Resolution in DPI) ]
End If
# Output to container
Set Field [ SVG to PNG::OutputFile ; MBS( "GMImage.WriteToPNGContainer"; $image; $name & ".png") ]
# Cleanup
Set Variable [ $r ; Value: MBS("GMImage.Release"; $image) ]
This function checks for a license.
Created 18th August 2014, last changed 16th December 2020