Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
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 |
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)
Invert image:
Set Variable [ $image ; Value: MBS( "GMImage.NewFromContainer"; Invert::Input ) ]
# each channel...
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "red") ]
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image) ]
// Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "blue") ]
# all channels...
Set Variable [ $r ; Value: MBS( "GMImage.InvertChannel"; $image; "rgb") ]
Set Field [ Invert::Output ; MBS( "GMImage.WriteToPNGContainer"; $image; "output.png") ]
Set Variable [ $r ; Value: MBS( "GMImage.Release"; $image) ]
See also
- GMImage.NewImagesFromContainer
- GMImage.ReadContainer
- GMImage.WriteToPNGContainer
- GMImage.WriteToTiffContainer
- ImageView.CreateWithControl
- ImageView.CreateWithSize
- OCR.GetText
- OCR.SetImage
- WinPDF.PageImage
- XL.Book.AddPictureContainer
Release notes
- Version 13.0
- Changed JPEG loader for GMImage.NewFromContainer, GMImage.NewFromFile and related to not stop loading of an image on a warning.
- Version 9.5
- Improved JPEG detection for byte streams, so we can detect if a PNG is actually a JPEG. Now GMImage.NewFromContainer can read JPEG, GIF, PNG, TIFF and BMP even if they are passed in wrong container format.
- Version 9.0
- Improved error handling for GMImage.NewFromContainer, so we pass on error messages from GraphicsMagick.
- Version 8.3
- Fixed GMImage.NewFromContainer to handle SVG files better.
- Version 7.2
- Fixed a bug with GMImage.NewFromContainer where referenced image file would stay open.
Example Databases
- DynaPDF/Click Points
- DynaPDF/WMF Conversion
- GraphicsMagick/Combine Pictures
- GraphicsMagick/Create GIF
- GraphicsMagick/Crop with Clicks
- GraphicsMagick/GraphicsMagick Exif
- GraphicsMagick/Image Scaling
- GraphicsMagick/Reduce Image
- Mac and iOS/ImageView
- Win Only/Window Icon
Blog Entries
- MBS Plugin Advent calendar: 16 - GraphicsMagick
- Tips and tricks with MBS
- Create thumbnail with GraphicsMagick
- GraphicsMagick in FileMaker, part 24
- GraphicsMagick in FileMaker, part 23
- GraphicsMagick in FileMaker, part 22
- GraphicsMagick in FileMaker, part 19
- GraphicsMagick in FileMaker, part 18
- GraphicsMagick in FileMaker, part 13
- GraphicsMagick in FileMaker, part 10
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 22nd November 2023