Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGImageSourceMBS class.

CGImageSourceMBS.CreateIncremental(options as Variant = nil) as CGImageSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Create an incremental image source.

options: A dictionary that specifies additional creation options. For example kCGImageSourceTypeIdentifierHint.

The function CreateIncremental creates an empty image source container to which you can add data later by calling the function UpdateData. You don't provide data when you call this function.

An incremental image is an image that is created in chunks, similar to the way large images viewed over the web are loaded piece by piece.

Available in Mac OS X version 10.4 and later.

Options can be a Dictionary or CFDictionaryMBS object.

CGImageSourceMBS.CreateThumbnailMT(data as MemoryBlock, ImageIndex as integer = 0, Options as Variant = nil) as CGImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates thumbnail for image thread friendly.

Data contains the image file data.
ImageIndex is the index of the image in the file to query.
Options contains various flags for options to creating image source and creating thumbnail.

Returns nil in case of any error.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.

Options can be a Dictionary or CFDictionaryMBS object.

See also:

Some examples using this method:

CGImageSourceMBS.CreateThumbnailMT(data as string, ImageIndex as integer = 0, Options as Variant = nil) as CGImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates thumbnail for image thread friendly.

Data contains the image file data.
ImageIndex is the index of the image in the file to query.
Options contains various flags for options to creating image source and creating thumbnail.

Returns nil in case of any error.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.

Options can be a Dictionary or CFDictionaryMBS object.

See also:

CGImageSourceMBS.CreateThumbnailMT(file as FolderItem, ImageIndex as integer = 0, Options as Variant = nil) as CGImageMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 19.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates thumbnail for image thread friendly.

File refers to image file on disk.
ImageIndex is the index of the image in the file to query.
Options contains various flags for options to creating image source and creating thumbnail.

Returns nil in case of any error.

The work is performed on a preemptive thread, so this function does not block the application and can yield time to other Xojo threads. Must be called in a Xojo thread to enjoy benefits. If called in main thread will block, but keep other background threads running.
If you run several threads calling MT methods, you can get all CPU cores busy while main thread shows GUI with progress window.

Options can be a Dictionary or CFDictionaryMBS object.

See also:

CGImageSourceMBS.CreateWithData(data as string, options as Variant = nil) as CGImageSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an image source that reads from a string.

data: The data string to read from.
options: A dictionary that specifies additional creation options. For example kCGImageSourceTypeIdentifierHint.

Returns an image source.
Available in Mac OS X version 10.4 and later.

Options can be a Dictionary or CFDictionaryMBS object.

CGImageSourceMBS.CreateWithFile(file as folderitem, options as Variant = nil) as CGImageSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an image source that reads from a location specified by a file.
Example
// get a picture file
Var file as FolderItem = SpecialFolder.Desktop.Child("sylwia.jpg")
// get image source
Var source as new CGImageSourceMBS(file)
// read image
Var image as CGImageMBS = source.CreateImageAtIndex(0)
// get Color space from image
Var profile as CGColorSpaceMBS = image.ColorSpace
// get ICC profile data
Var ICCProfile as string = profile.ICCProfile
// and parse it with LCMS and show name
Var LCMSProfile as LCMS2ProfileMBS = LCMS2ProfileMBS.OpenProfileFromString(ICCProfile)
MsgBox LCMSProfile.Name

url: The URL to read from.

options: A dictionary that specifies additional creation options. For example kCGImageSourceTypeIdentifierHint.

Returns an image source.

Available in Mac OS X version 10.4 and later.

Options can be a Dictionary or CFDictionaryMBS object.

CGImageSourceMBS.CreateWithURL(url as string, options as Variant = nil) as CGImageSourceMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates an image source that reads from a location specified by a URL.

url: The URL to read from.

options: A dictionary that specifies additional creation options. For example kCGImageSourceTypeIdentifierHint.

On success the handle value is not zero.

Available in Mac OS X version 10.4 and later.

Options can be a Dictionary or CFDictionaryMBS object.

CGImageSourceMBS.TypeIdentifiers as string()

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method CoreGraphics MBS MacCG Plugin 9.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an array of uniform type identifiers (UTIs) that are supported for image sources.
Example
Var s(-1) as string = CGImageSourceMBS.TypeIdentifiers

MsgBox Join(s,EndOfLine)

// shows:
//
// public.png
// public.jpeg
// com.compuserve.gif
// public.jpeg-2000
// com.adobe.raw-image
// com.leafamerica.raw-image
// com.hasselblad.fff-raw-image
// com.hasselblad.3fr-raw-image
// com.nikon.raw-image
// com.nikon.nrw-raw-image
// com.pentax.raw-image
// com.sony.sr2-raw-image
// com.sony.arw-raw-image
// com.epson.raw-image
// com.kodak.raw-image
// public.tiff
// com.apple.icns
// com.canon.tif-raw-image
// com.canon.cr2-raw-image
// com.canon.crw-raw-image
// com.fuji.raw-image
// com.panasonic.raw-image
// com.panasonic.rw2-raw-image
// com.panasonic.rwl-raw-image
// com.leica.pwl-raw-image
// com.konicaminolta.raw-image
// com.olympus.raw-image
// com.olympus.raw-image
// com.sony.raw-image
// com.adobe.photoshop-image
// com.adobe.pdf
// com.adobe.illustrator.ai-image
// com.microsoft.ico
// com.microsoft.bmp
// public.xbitmap-image
// com.microsoft.cur
// com.apple.pict
// com.truevision.tga-image
// com.sgi.sgi-image
// com.apple.quicktime-image
// com.kodak.flashpix-image
// com.apple.macpaint-image
// com.ilm.openexr-image
// public.radiance

Returns an array of the UTIs that are supported for image sources.

See Uniform Type Identifiers Overview for a list of system-declared and third-party UTIs.

Available in Mac OS X version 10.4 and later.

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


The biggest plugin in space...