Platforms to show: All Mac Windows Linux Cross-Platform
Back to CGContextMBS class.
CGContextMBS.clearRect(rect as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Remeber that in CoreGraphics the position 0/0 is in the bottom left corner. In Xojo 0/0 is in the top left corner.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Intersect the context's path with the current clip path and use the resulting path as the clip path for subsequent rendering operations. Use the winding-number fill rule for deciding what's inside the path.
CGContextMBS.ClipToMask(rect as CGRectMBS, mask as CGImageMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
rect: The rectangle to map the mask parameter to.
mask: An image or an image mask. If mask is an image, then it must be in the DeviceGray color space, may not have an alpha component, and may not be masked by an image mask or masking color.
If the mask parameter is an image mask, then Quartz clips in a manner identical to the behavior seen with the function DrawImage—the mask indicates an area to be left unchanged when drawing. The source samples of the image mask determine which points of the clipping area are changed, acting as an "inverse alpha" value. If the value of a source sample in the image mask is S, then the corresponding point in the current clipping area is multiplied by an alpha value of (1–S). For example, if S is 1 then the point in the clipping area becomes transparent. If S is 0, the point in the clipping area is unchanged.
If the mask parameter is an image, then mask acts like an alpha mask and is blended with the current clipping area. The source samples of mask determine which points of the clipping area are changed. If the value of the source sample in mask is S, then the corresponding point in the current clipping area is multiplied by an alpha of S. For example, if S is 0, then the point in the clipping area becomes transparent. If S is 1, the point in the clipping area is unchanged.
Available in Mac OS X v10.4 and later.
CGContextMBS.clipToRect(rect as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Intersect the current clipping path with 'rect'. Note that this function resets the context's path to the empty path.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 15.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Same as destructor later, but running now when you call method.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.ConcatCTM(transform as CGAffineTransformMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 4.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.Constructor(g as graphics)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 20.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Raises exception if we fail to get the CGContext from Xojo.
Works on macOS and iOS.
See also:
CGContextMBS.Constructor(handle as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 13.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The CGContext is retained.
See also:
CGContextMBS.Constructor(pic as Picture)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 20.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Raises exception, if the picture is not a bitmap picture.
Works on macOS and iOS.
See also:
CGContextMBS.CopyPath as CGPathMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Available in Mac OS X v10.6 and later.
The items on this page are in the following plugins: MBS MacCG Plugin.