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
Read single image frame into current object.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 10.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
(old name: GMImage.ReadFromContainer)
Parameter | Description | Example | Flags |
---|---|---|---|
ImageRef | The image reference number. | 1 | |
data | The container value, either a variable or a container field. | ||
Geometry | The rectangle. Geometry is specified as a width and height "100x200". Can be empty. |
Optional | |
Depth | Color depth parameter. | 0 | Optional |
Magick | The codec to use to read file. | Optional |
Returns OK or error.
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.ReadContainer"; $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) ]
Try GraphicsMagick in file WMF Conversion
Set Variable [ $image ; Value: MBS( "GMImage.New"; "300x300"; "white" ) ]
Set Variable [ $r ; Value: MBS( "GMImage.SetMagick"; $image; "EMF") ]
Set Variable [ $r ; Value: MBS( "GMImage.ReadContainer"; $Image; WMF Conversion::Input WMF) ]
If [ MBS("IsError") ]
Show Custom Dialog [ "Error" ; $r ]
Else
Set Field [ WMF Conversion::Output PNG ; MBS( "GMImage.WriteToPNGContainer"; $image) ]
Set Variable [ $r ; Value: MBS("GMImage.Release"; $image) ]
End If
This function checks for a license.
Created 7th April 2020, last changed 24th November 2021