Platforms to show: All Mac Windows Linux Cross-Platform
CGImageDestinationMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | Console & Web | iOS |
class | CoreGraphics | MBS MacCG Plugin | 9.5 | Yes | No | No | Yes, macOS only | No |
Example:
dim logo as Picture = LogoMBS(500)
dim image as CGImageMBS = CGCreateImageMBS(logo)
dim dic as new Dictionary
// 10%
'dic.Value(CGImageDestinationMBS.kCGImageDestinationLossyCompressionQuality)=0.1
// 100%
dic.Value(CGImageDestinationMBS.kCGImageDestinationLossyCompressionQuality)=1.0
dim file as FolderItem = SpecialFolder.Desktop.Child("logo.jpg")
dim d as new CGImageDestinationMBS(file, "public.jpeg", 1)
d.AddImage(image, dic)
if d.Finalize then
MsgBox "Saved"
else
MsgBox "Failed to save."
end if
CGImageDestination objects, available in Mac OS X v10.4 or later, abstract the data-writing task. An image destination can represent a single image or multiple images. It can contain thumbnail images as well as properties for each image.
The functions described in this reference can write data to three kinds of destinations: a file, an URL and a string. After creating a CGImageDestination object for the appropriate destination, you can add image data and set image properties. When you are finished adding data, call the function Finalize to write the image data and properties.
- property Handle as Integer
- 12 methods
- method AddImage(image as CGImageMBS, properties as dictionary=nil)
- method AddImageCF(image as CGImageMBS, properties as Variant = nil)
- method AddImageFromSource(source as CGImageSourceMBS, index as Integer, options as dictionary = nil)
- method AddImageFromSourceCF(source as CGImageSourceMBS, index as Integer, options as Variant = nil)
- method Constructor(file as folderitem, type as string, count as Integer = 1)
- method Constructor(type as string, count as Integer = 1)
- method Constructor(url as string, type as string, count as Integer = 1)
- method Data as string
- method Finalize as boolean
- method FinalizeMT as boolean
- method SetProperties(options as dictionary = nil)
- method SetPropertiesCF(options as Variant)
- 11 shared methods
- shared method CreateWithData(type as string, count as Integer = 1) as CGImageDestinationMBS
- shared method CreateWithFile(file as folderitem, type as string, count as Integer = 1) as CGImageDestinationMBS
- shared method CreateWithURL(url as string, type as string, count as Integer = 1) as CGImageDestinationMBS
- shared method kCGImageDestinationBackgroundColor as string
- shared method kCGImageDestinationDateTime as string
- shared method kCGImageDestinationLossyCompressionQuality as string
- shared method kCGImageDestinationMergeMetadata as string
- shared method kCGImageDestinationMetadata as string
- shared method kCGImageDestinationOrientation as string
- shared method kCGImageMetadataShouldExcludeXMP as string
- shared method TypeIdentifiers as string()
This class has no sub classes.
Some examples which use this class:
Blog Entries
- Problems with killing Xojo threads with plugin calls.
- Tip of the day: Edit IPTC data in JPEG file with CGImageSource/CGImageDestination
- MBS Xojo / Real Studio Plugins, version 13.5pr8
The items on this page are in the following plugins: MBS MacCG Plugin.
Links
MBS FileMaker blog