Xojo Conferences
MBSOct2019CologneDE

Platforms to show: All Mac Windows Linux Cross-Platform

CGImageSourceMBS.Constructor(data as string, options as dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates an image source that reads from a string.
Notes:
data: The data string 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.

See also:

Feedback, Comments & Corrections

CGImageSourceMBS.Constructor(file as folderitem, options as dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates an image source that reads from a location specified by a file.
Notes:
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.

See also:

Feedback, Comments & Corrections

CGImageSourceMBS.Constructor(options as dictionary = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Create an incremental image source.
Notes:
options: A dictionary that specifies additional creation options. For example kCGImageSourceTypeIdentifierHint.

Returns an image source object.

The constructor 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.

See also:

Feedback, Comments & Corrections

CGImageSourceMBS.CreateImageAtIndex(index as Integer, options as dictionary = nil) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates a CGImage object for the image data associated with the specified index in an image source.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim c as new CGImageSourceMBS(file)
dim img as CGImageMBS = c.CreateImageAtIndex(0)

Backdrop=img.Picture
Notes:
index: The index that specifies the location of the image. The index is zero-based.

options: A dictionary that specifies additional creation options.

Returns a CGImage object.

Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.CreateThumbnailAtIndex(index as Integer, options as dictionary = nil) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Creates a thumbnail image of the image located at a specified location in an image source.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim c as new CGImageSourceMBS(file)

dim d as new Dictionary
d.Value(c.kCGImageSourceThumbnailMaxPixelSize)=200
d.Value(c.kCGImageSourceCreateThumbnailFromImageIfAbsent)=true

dim img as CGImageMBS = c.CreateThumbnailAtIndex(0,d)

Backdrop=img.Picture
Notes:
index: The index that specifies the location of the image. The index is zero-based.

options: A dictionary that specifies additional creation options.

Returns a CGImageMBS.

If the image source is a PDF, this function creates a 72 dpi image of the PDF page specified by the index that you pass. You must, however, pass an options dictionary that contains either the kCGImageSourceCreateThumbnailFromImageIfAbsent or kCGImageSourceCreateThumbnailFromImageAlways keys, with the value of the key set to TRUE.

Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.Properties(options as dictionary = nil) as dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Returns the properties of the image source.
Example:
dim inputfile as FolderItem = SpecialFolder.Desktop.Child("test.jpg")

// reading the picture
dim c as new CGImageSourceMBS(inputfile)
dim img as CGImageMBS = c.CreateImageAtIndex(0)
dim propertiesGlobal as Dictionary = c.Properties
dim propertiesImage as Dictionary = c.PropertiesAtIndex(0)

dim outputFile as FolderItem = SpecialFolder.Desktop.Child("output.jpg")
dim d as new CGImageDestinationMBS(outputFile, "public.jpeg", 1)

// writing the picture and include metadata
d.SetProperties(propertiesGlobal)
d.AddImage(img, propertiesImage)
if d.FinalizeMT then
outputFile.Launch
else
MsgBox "Failed to write jpeg."
end if
Notes:
options: A dictionary you can use to request additional options.
Returns a dictionary that contains the properties associated with the image source container.
These properties apply to the container in general but not necessarily to any individual image contained in the image source.
Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.PropertiesAtIndex(index as Integer, options as dictionary = nil) as dictionary
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Returns the properties of the image at a specified location in an image source.
Example:
dim file as FolderItem = SpecialFolder.Desktop.Child("test.jpg")
dim c as new CGImageSourceMBS(file)

dim d as Dictionary = c.PropertiesAtIndex(0)

dim e as Dictionary
e=d.Value(c.kCGImagePropertyExifDictionary)

if e<>Nil then
dim keys(-1) as Variant = e.Keys
dim lines(-1) as string

for each key as string in keys
lines.Append key+": "+e.Value(key)
next

MsgBox "Exif: "+EndOfLine+EndOfLine+Join(lines,EndOfLine)
end if

e=d.Value(c.kCGImagePropertyGPSDictionary)

if e<>Nil then
dim keys(-1) as Variant = e.Keys
dim lines(-1) as string

for each key as string in keys
lines.Append key+": "+e.Value(key)
next

MsgBox "GPS: "+EndOfLine+EndOfLine+Join(lines,EndOfLine)
end if
Notes:
index: The index of the image whose properties you want to obtain. The index is zero-based.
options: A dictionary you can use to request additional options.
Returns a dictionary that contains the properties associated with the image.
Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.PropertiesAtIndexCF(index as Integer, options as Variant = nil) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 13.5 Yes No No Yes, macOS only No
Function: Returns the properties of the image at a specified location in an image source.
Notes:
index: The index of the image whose properties you want to obtain. The index is zero-based.
options: A dictionary or CFDictionaryMBS you can use to request additional options.
Returns a CFDictionaryMBS that contains the properties associated with the image.
Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.PropertiesCF(options as Variant = nil) as Variant
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 13.5 Yes No No Yes, macOS only No
Function: Returns the properties of the image source.
Notes:
options: A dictionary or CFDictionaryMBS you can use to request additional options.
Returns a CFDictionaryMBS that contains the properties associated with the image source container.
These properties apply to the container in general but not necessarily to any individual image contained in the image source.
Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.StatusAtIndex(index as Integer) as Integer
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Returns the current status of an image that is at a specified location in an image source.
Notes:
index: The index of the image whose status you want to obtain. The index is zero-based.

Returns the current status of the image.

The status is particularly informative for incremental image sources, but may also be used by clients that provide non-incremental data.

Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

CGImageSourceMBS.UpdateData(data as string, final as boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreGraphics MBS MacCG Plugin 9.5 Yes No No Yes, macOS only No
Function: Updates an incremental image source with new data.
Notes:
data: The data to add to the image source. Each time you call the function UpdateData, the data parameter must contain all of the image file data accumulated so far.

final: A value that specifies whether the data is the final set. Pass true if it is, false otherwise.

Available in Mac OS X version 10.4 and later.

Feedback, Comments & Corrections

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

The biggest plugin in space...




Links
MBS FileMaker Plugins