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: 9.1   9.2   9.3   9.4   9.5   10.0   10.1   10.2   10.3   10.4    Statistic  


Exports the image as container value.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
CGImageSource 9.4 Yes No Yes, macOS only No Yes
MBS( "CGImageSource.Export"; Ref; FileName )   More


Parameter Description Example value
Ref The image source reference number returned by CGImageSource.CreateWithData, CGImageSource.CreateWithPath or CGImageSource.CreateWithURL $ref
FileName The file name to use.
If empty, we use the name of the loaded image.
Falls back to export.jpg if no name is provided.
Image destination is defined by file type from file name.


Returns container value or error.


Exports the image as container value.
Uses the image compression based on the file name used.
If possible, we move through data without recompressing image.

Use Container.WriteFile to write the image to a disk file.


Changes some metadata and exports image:

Set Variable [ $ref ; Value: MBS("CGImageSource.CreateWithData"; CGImageSource::ImageFile) ]
Set Variable [ $keys ; Value: MBS( "CGImageSource.SetProperty"; $ref; 0; "{IPTC}.Keywords"; "House,Garden" ) ]
Set Variable [ $keys ; Value: MBS( "CGImageSource.SetProperty"; $ref; 0; "{IPTC}.Caption/Abstract"; "House with garden" ) ]
Set Variable [ $keys ; Value: MBS( "CGImageSource.SetProperty"; $ref; 0; "{TIFF}.ImageDescription"; "House with garden" ) ]
Set Variable [ $Image ; Value: MBS("CGImageSource.Export"; $ref) ]
Set Field [ CGImageSource::output ; $image ]
Set Variable [ $r ; Value: MBS("CGImageSource.Release"; $ref) ]

See also

Example Databases

Blog Entries

Release notes

Created 30th August 2019, last changed 12nd September 2019

CGImageSource.CreateWithURL   -   CGImageSource.FileName

Feedback: Report problem or ask question.

MBS Xojo Plugins