Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
CGImageSource.Export
Exports the image as container value.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
CGImageSource | 9.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |
Parameters
Parameter | Description | Example |
---|---|---|
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. |
"test.jpg" |
Result
Returns container value or error.
Description
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.
Examples
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
- CGImageSource.Count
- CGImageSource.CreateWithData
- CGImageSource.CreateWithPath
- CGImageSource.CreateWithURL
- CGImageSource.List
- CGImageSource.Property
- CGImageSource.Release
- CGImageSource.SetProperty
- CGImageSource.Type
- Container.WriteFile
Release notes
- Version 9.4
- Added CGImageSource.Export and CGImageSource.SupportedExportTypes functions to export image.
Example Databases
Blog Entries
This function checks for a license.
Created 30th August 2019, last changed 12nd September 2019