Xojo Conferences
XDCMay2019MiamiUSA

Platforms to show: All Mac Windows Linux Cross-Platform

CIContextMBS.ClearCaches
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Frees any cached data (such as temporary images) associated with the context.
Notes: This also runs the garbage collector.

Feedback, Comments & Corrections

CIContextMBS.Constructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Creates a new CIContext without a specific target.
Notes: Great to create a context and render something inside.

See also:

Feedback, Comments & Corrections

CIContextMBS.Constructor(cgcontext as CGContextMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Create a new CoreImage context object, all output will be drawn into the CG context.
Notes: On success, the handle is not zero.

See also:

Feedback, Comments & Corrections

CIContextMBS.Constructor(cgcontext as CGContextMBS, OutputColorSpace as CGColorSpaceMBS, WorkingColorSpace as CGColorSpaceMBS, UseSoftwareRenderer as Boolean)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Create a new CoreImage context object with options, all output will be drawn into the CG context.
Notes:
OutputColorSpace: A CGColorSpaceMBS object defining the color space in which all intermediate operations are performed.
WorkingColorSpace: A CGColorSpaceRef object defining the color space that images are converted to before rendering into the context.
UseSoftwareRenderer: Whether you want software renderer only.

On success, the handle is not zero.

See also:

Feedback, Comments & Corrections

CIContextMBS.Constructor(Handle as Integer)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 12.1 Yes No No Yes, macOS only No
Function: Initializes object with given object reference.
Notes:
ref should be a CIContext* and the object is retained.
Raises UnsupportedOperationException if object is not a CIContext.

See also:

Feedback, Comments & Corrections

CIContextMBS.Constructor(Pic as Picture)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes Yes Yes Yes No
Function: Creates a context targeting the picture.
Notes: Works only on Cocoa target.

See also:

Feedback, Comments & Corrections

CIContextMBS.CreateCGImage(image as CIImageMBS, r as CGRectMBS = nil) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Creates a new image with the content of the CIImage.
Notes:
Render the region 'r' of image 'im' into a temporary buffer using the context, then create and return a new CoreGraphics image with the results.
If r is nil, the whole image extent is used.

See also:

Feedback, Comments & Corrections

CIContextMBS.CreateCGImage(image as CIImageMBS, r as CGRectMBS, ColorSpace as CGColorSpaceMBS) as CGImageMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Creates a new image with the content of the CIImage.
Notes:
Render the region 'r' of image 'im' into a temporary buffer using the context, then create and return a new CoreGraphics image with the results.
If r is nil, the whole image extent is used.

See also:

Feedback, Comments & Corrections

CIContextMBS.createCGLayer(size as CGSizeMBS, info as dictionary = nil) as CGLayerMBS
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 14.1 Yes No No Yes, macOS only No
Function: Creates a CGLayer object from the provided parameters.
Notes:
size: The size, in default user space units, of the layer relative to the graphics context.
ifno: A dictionary, which is passed to CGLayerCreateWithContext as the auxiliaryInfo parameter. Pass nil because this parameter is reserved for future use.

Returns a CGLayer object.

After calling this method, Core Image draws content into the CGLayer object. Core Image creates a CGLayer object by calling the Quartz 2D function CGLayerCreateWithContext, whose prototype is:

CGLayerRef CGLayerCreateWithContext (
CGContextRef context,
CGSize size,
CFDictionaryRef auxiliaryInfo
);
Core Image passes the CIContext object as the context parameter, the size as the size parameter, and the dictionary as the auxiliaryInfo parameter. For more information on CGLayer objects, see Quartz 2D Programming Guide and CGLayer Reference.

Available in OS X v10.4 and later.

Feedback, Comments & Corrections

CIContextMBS.Destructor
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: The destructor.

Feedback, Comments & Corrections

CIContextMBS.DrawImage(ciImage as CIImageMBS)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Render the ciImage to the the context's destination.
Notes: Rendering the image will cause the calculations to be done so this call is quite expensive.

Feedback, Comments & Corrections

CIContextMBS.DrawImagePoint(ciImage as CIImageMBS, DestPoint as CGPointMBS, SourceRect as CGRectMBS = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Render the subregion 'SourceRect' of 'ciImage' to point 'DestPoint' in the context's destination.
This item is deprecated and should no longer be used. You can use DrawImageRect instead.
Notes:
Rendering the image will cause the calculations to be done so this call is quite expensive.
If SourceRect is nil, we use the extent from image.

Feedback, Comments & Corrections

CIContextMBS.DrawImageRect(ciImage as CIImageMBS, DestRect as CGRectMBS, SourceRect as CGRectMBS = nil)
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Render the rectangle 'SourceRect' of 'ciImage' to the rectangle 'DestRect' in the context's destination.
Notes:
Rendering the image will cause the calculations to be done so this call is quite expensive.
If SourceRect is nil, we use the extent from image.

Feedback, Comments & Corrections

CIContextMBS.Flush
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 13.1 Yes No No Yes, macOS only No
Function: Flushes drawings to CGContext and target picture (if any).

Feedback, Comments & Corrections

CIContextMBS.JPEGRepresentationOfImage(Image as CIImageMBS, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to JPEG data.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS

dim jpegData as MemoryBlock = c.JPEGRepresentationOfImage(i)

Break // see debugger
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome.
Supported options keys are kCGImageDestinationLossyCompressionQuality, kCIImageRepresentationAVDepthData, kCIImageRepresentationDepthImage, kCIImageRepresentationDisparityImage.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.12 or later.

Feedback, Comments & Corrections

CIContextMBS.PNGRepresentationOfImage(Image as CIImageMBS, format as Integer = 24, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to PNG data.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS

dim pngData as MemoryBlock = c.PNGRepresentationOfImage(i)

Break // see debugger
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified format.
No options keys are supported at this time.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.13 or later.

Feedback, Comments & Corrections

CIContextMBS.ReclaimResources
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 7.3 Yes No No Yes, macOS only No
Function: Frees temporary memory.
Notes: Runs the context's garbage collector to reclaim any resources that are no longer required (e.g. removes textures from the texture cache that reference deleted images.) This method is called automatically after every rendering operation.

Feedback, Comments & Corrections

CIContextMBS.TIFFRepresentationOfImage(Image as CIImageMBS, format as Integer = 24, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil) as MemoryBlock
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to TIFF data.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS

dim tiffData as MemoryBlock = c.TIFFRepresentationOfImage(i)

Break // see debugger
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified format.
No options keys are supported at this time.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.12 or later.

Feedback, Comments & Corrections

CIContextMBS.writeJPEGRepresentationOfImage(Image as CIImageMBS, file as FolderItem, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil, byref error as NSErrorMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to JPEG file.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS
dim d as FolderItem = SpecialFolder.Desktop.Child("output.jpg")

dim e as NSErrorMBS
dim b as Boolean = c.writeJPEGRepresentationOfImage(i, d, e)
if b then
MsgBox "OK"
else
MsgBox "Failed"+EndOfLine+e.LocalizedDescription
end if
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome.
Supported options keys are kCGImageDestinationLossyCompressionQuality, kCIImageRepresentationAVDepthData, kCIImageRepresentationDepthImage, kCIImageRepresentationDisparityImage.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.12 or later.

Feedback, Comments & Corrections

CIContextMBS.writePNGRepresentationOfImage(Image as CIImageMBS, file as FolderItem, format as Integer = 24, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil, byref error as NSErrorMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to PNG file.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS
dim d as FolderItem = SpecialFolder.Desktop.Child("output.png")

dim e as NSErrorMBS
dim b as Boolean = c.writePNGRepresentationOfImage(i, d, e)
if b then
MsgBox "OK"
else
MsgBox "Failed"+EndOfLine+e.LocalizedDescription
end if
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified format.
No options keys are supported at this time.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.13 or later.

Feedback, Comments & Corrections

CIContextMBS.writeTIFFRepresentationOfImage(Image as CIImageMBS, file as FolderItem, format as Integer = 24, colorSpace as CGColorSpaceMBS = nil, options as dictionary = nil, byref error as NSErrorMBS) as Boolean
Type Topic Plugin Version macOS Windows Linux Console & Web iOS
method CoreImage MBS MacCG Plugin 17.3 Yes No No Yes, macOS only No
Function: Render a CIImage to TIFF file.
Example:
dim f as FolderItem = SpecialFolder.Desktop.Child("test.png")
dim i as new CIImageMBS(f)
dim c as new CIContextMBS
dim d as FolderItem = SpecialFolder.Desktop.Child("output.tif")

dim e as NSErrorMBS
dim b as Boolean = c.writeTIFFRepresentationOfImage(i, d, e)
if b then
MsgBox "OK"
else
MsgBox "Failed"+EndOfLine+e.LocalizedDescription
end if
Notes:
Image must have a finite non-empty extent.
The CGColorSpace must be kCGColorSpaceModelRGB or kCGColorSpaceModelMonochrome and must match the specified format.
No options keys are supported at this time.
If colorspace is nil, we use generic RGB colorspace.
Available on macOS 10.12 or later.

Feedback, Comments & Corrections

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




Links
MBS FileMaker blog