Platforms to show: All Mac Windows Linux Cross-Platform

CGImageDestinationMBS class

Type Topic Plugin Version macOS Windows Linux iOS Targets
class CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
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

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.

This class has no sub classes.

Some examples using this class:

Blog Entries


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


CGGradientMBS   -   CGImageMBS


The biggest plugin in space...