Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

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
Function: A class to write CGImages.
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
Notes:
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.

Feedback, Comments & Corrections

This class has no sub classes.

Some examples which use this class:


The items on this page are in the following plugins: MBS MacCG Plugin.


CGGradientMBS   -   CGImageMBS




Links
MBS FileMaker Plugins