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.0   12.1   12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3    Statistic    FMM    Blog  

GMImage.NewFromContainer

Loads a picture from the given container.

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

Parameters

Parameter Description Example
data A value from a Container Field.
Can include various image formats like JPEG, PNG or just containers with FILE data.

Result

Returns the ImageRef number on success.

Description

Loads a picture from the given container.
Please call GMImage.Release later to free memory for this image.
Image reference numbers are starting at 18000 and counting up for each new image.

If image doesn't load, please check whether it's a HEIC, HEIF or RAW image. For those, please use Container.ReadImage first to convert on macOS/iOS/Windows.

When the container has a PDF, the plugin may just load the preview image. Please use DynaPDF.RenderPage, PDFKit.GetPDFPageImage or WinPDF.PageImage to render an image from the PDF first, before loading it.

Examples

Show with and height

Let ( [
$Image = MBS("GMImage.NewFromContainer"; GraphicsMagick::image);
$Width = MBS("GMImage.GetWidth";$Image);
$Height = MBS("GMImage.GetHeight";$Image);
$Error = MBS("GMImage.Release";$Image)
];
$Width & " x " & $Height )

Load from container:

MBS( "GMImage.NewFromContainer"; test::test)

See also

Release notes

Example Databases

Blog Entries

This function checks for a paid license.

Created 18th August 2014, last changed 11st April 2023


GMImage.NewFromBase64 - GMImage.NewFromFile

💬 Ask a question or report a problem


Start Chat