Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGLayerMBS class.

CGLayerMBS.Constructor(context as CGContextMBS, size as CGSizeMBS, auxiliaryInfo as dictionary = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 12.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a CGLayer object that is associated with a graphics context.

context: The graphics context you want to create the layer relative to. The layer uses this graphics context as a reference for initialization.
size: The size, in default user space units, of the layer relative to the graphics context.
auxiliaryInfo: Reserved for future use. Pass nil.

On Success the handle property is not nil.

After you create a CGLayer object, you should reuse it whenever you can to facilitate the Quartz caching strategy. Quartz caches any objects that are reused, including CGLayer objects. Objects that are reused frequently remain in the cache. In contrast, objects that are used once in a while may be moved in and out of the cache according to their frequency of use. If you don't reuse CGLayer objects, Quartz won't cache them. This means that you lose an opportunity to improve the performance of your application.

Available in Mac OS X version 10.4 and later.

See also:

CGLayerMBS.Constructor(context as CGContextMBS, width as Double, height as Double, auxiliaryInfo as dictionary = nil)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 12.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a CGLayer object that is associated with a graphics context.

context: The graphics context you want to create the layer relative to. The layer uses this graphics context as a reference for initialization.
width/height: The size, in default user space units, of the layer relative to the graphics context.
auxiliaryInfo: Reserved for future use. Pass nil.

On Success the handle property is not nil.

After you create a CGLayer object, you should reuse it whenever you can to facilitate the Quartz caching strategy. Quartz caches any objects that are reused, including CGLayer objects. Objects that are reused frequently remain in the cache. In contrast, objects that are used once in a while may be moved in and out of the cache according to their frequency of use. If you don't reuse CGLayer objects, Quartz won't cache them. This means that you lose an opportunity to improve the performance of your application.

Available in Mac OS X version 10.4 and later.

See also:

CGLayerMBS.Context as CGContextMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 12.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the graphics context associated with a CGLayer object.

The context that's returned is the context for the layer itself, not the context that you specified when you created the layer.

CGLayerMBS.Size as CGSizeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 12.2 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the width and height of a CGLayer object.

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


The biggest plugin in space...