Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Guides   Examples
New in version: 9.0   9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3    Statistic  


Read single image frame into current object.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 10.2 Yes Yes Yes Yes Yes
MBS( "GMImage.ReadFromContainer"; ImageRef; data { ; Geometry; Depth; Magick } )   More


Parameter Description Example value
ImageRef The image reference number. 1
data A value from a Container Field.
Geometry Optional
The rectangle.
Geometry is specified as a width and height "100x200".
Can be empty.
Depth Optional
Color depth parameter.
Magick Optional
The codec to use to read file.


Returns OK or error.


Read single image frame into current object.
This allows you to set options before reading in image.

You may want to use GMImage.SetBackgroundColor, GMImage.SetMagick, GMImage.SetFileName or other settings before calling this.


Convert a SVG image to PNG with alpha channel:

# Load image from container
Set Variable [ $image ; Value: MBS( "GMImage.New"; "500x500"; "transparent" ) ]
# turn on alpha channel and set background to transparent
Set Variable [ $r ; Value: MBS( "GMImage.SetType"; $image; 7 ) ]
Set Variable [ $r ; Value: MBS( "GMImage.SetBackgroundColor"; $Image; "transparent" ) ]
# read SVG
Set Variable [ $r ; Value: MBS( "GMImage.ReadFromContainer"; $image; SVG to PNG::InputFile; "500x500"; 0; "SVG" ) ]
# Output to container and release image
Set Field [ SVG to PNG::OutputFile ; MBS( "GMImage.WriteToPNGContainer"; $image; "test.png") ]
Set Variable [ $r ; Value: MBS("GMImage.Free"; $image) ]

See also

Example Databases

Blog Entries

Release notes

Created 7th April 2020, last changed 14th May 2020

GMImage.Read   -   GMImage.ReduceNoise

Feedback: Report problem or ask question.

MBS Xojo Plugins