Platforms to show: All Mac Windows Linux Cross-Platform
Back to CGContextMBS class.
CGContextMBS.addArcToPath(x as Double, y as Double, w as Double, h as Double, startAngle as Integer, arcAngle as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.AddEllipseInRect(r as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
See the function CGPathMBS.AddEllipseInRect for more information on how the path for the ellipse is constructed.
Requires Mac OS X 10.4.
CGContextMBS.addOvalToPath(x as Double, y as Double, w as Double, h as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.AddPath(path as CGPathMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The points in path are transformed by the CTM of context before they are added.
Requires Mac OS X 10.2.
CGContextMBS.addRoundedRectToPath(x as Double, y as Double, w as Double, h as Double, arcWidth as Double, arcHeight as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.BeginPage(mediabox as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Note that a context has a double path in use at any time: a path is not part of the graphics state.
Some examples using this method:
CGContextMBS.BeginTransparencyLayer(auxiliaryInfo as Dictionary = nil)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
All subsequent drawing operations until a corresponding EndTransparencyLayer are composited into a fully transparent backdrop (which is treated as a separate destination buffer from the context). After the transparency layer is ended, the result is composited into the context using the global alpha and shadow state of the context. This operation respects the clipping region of the context. After a call to this function, all of the parameters in the graphics state remain unchanged with the exception of the following:
- The global alpha is set to 1.
- The shadow is turned off.
- The blend mode is set to 'kCGBlendModeNormal'.
Ending the transparency layer restores these parameters to the values they had before BeginTransparencyLayer was called. Transparency layers may be nested.
CGContextMBS.BeginTransparencyLayerWithRect(r as CGRectMBS, auxiliaryInfo as Dictionary = nil)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 12.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
This function is identical to BeginTransparencyLayer except that the content of the transparency layer will be bounded by rect (specified in user space).
CGContextMBS.DrawCGPDFDocument(pdf as Variant, rect as CGRectMBS, page as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ❌ No | Desktop, Console & Web |
Pass a CGPDFDocumentMBS object for the pdf argument.
The media box of the page is scaled, if necessary, to fit into 'rect'.
Some examples using this method:
CGContextMBS.DrawLayerAtPoint(Point as CGPointMBS, layer as CGLayerMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
context: The graphics context associated with the layer.
point: The location, in current user space coordinates, to use as the origin for the drawing.
layer: The layer whose contents you want to draw.
Calling the function DrawLayerAtPoint is equivalent to calling the function DrawLayerInRect with a rectangle that has its origin at point and its size equal to the size of the layer.
Available in Mac OS X version 10.4 and later.
CGContextMBS.DrawLayerInRect(rect as CGRectMBS, layer as CGLayerMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 12.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
context: The graphics context associated with the layer.
rect: The rectangle, in current user space coordinates, to draw to.
layer: The layer whose contents you want to draw.
The contents are scaled, if necessary, to fit into the rectangle.
Available in Mac OS X version 10.4 and later.
CGContextMBS.DrawLinearGradient(gradient as CGGradientMBS, startPoint as CGPointMBS, endPoint as CGPointMBS, options as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
gradient: A CGGradient object.
startPoint: The coordinate that defines the starting point of the gradient.
endPoint: The coordinate that defines the ending point of the gradient.
options: Option flags (kCGGradientDrawsBeforeStartLocation or kCGGradientDrawsAfterEndLocation) that control whether the fill is extended beyond the starting or ending point.
The color at location 0 in the CGGradient object is mapped to the starting point. The color at location 1 in the CGGradient object is mapped to the ending point. Colors are linearly interpolated between these two points based on the location values of the gradient. The option flags control whether the gradient is drawn before the start point or after the end point.
Available in Mac OS X v10.5 and later.
Some examples using this method:
CGContextMBS.DrawPath(mode as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.DrawPicture(pic as CGImageMBS, 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.
CGContextMBS.DrawRadialGradient(gradient as CGGradientMBS, startCenter as CGPointMBS, startRadius as Double, endCenter as CGPointMBS, endRadius as Double, options as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
gradient: A CGGradient object.
startCenter: The coordinate that defines the center of the starting circle.
startRadius: The radius of the starting circle.
endCenter: The coordinate that defines the center of the ending circle.
endRadius: The radius of the ending circle.
options: Option flags (kCGGradientDrawsBeforeStartLocation or kCGGradientDrawsAfterEndLocation) that control whether the gradient is drawn before the starting circle or after the ending circle.
The color at location 0 in the CGGradient object is mapped to the circle defined by startCenter and startRadius. The color at location 1 in the CGGradient object is mapped to the circle defined by endCenter and endRadius. Colors are linearly interpolated between the starting and ending circles based on the location values of the gradient. The option flags control whether the gradient is drawn before the start point or after the end point.
Available in Mac OS X v10.5 and later.
Some examples using this method:
CGContextMBS.DrawShading(shading as CGShadingMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 6.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
shading: A Quartz shading. Quartz retains this object; upon return, you may safely release it.
Available in Mac OS X version 10.2 and later.
CGContextMBS.DrawTiledImage(pic as CGImageMBS, rect as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
rect: A rectangle that specifies the origin and size of the destination tile. Quartz scales the image—disproportionately, if necessary—to fit the bounds specified by the rect parameter.
image: The image to draw.
Quartz draws the scaled image starting at the origin of the rectangle in user space, then moves to a new point (horizontally by the width of the tile and/or vertically by the height of the tile), draws the scaled image, moves again, draws again, and so on, until the current clip region is tiled with copies of the image. Unlike patterns, the image is tiled in user space, so transformations applied to the CTM affect the final result.
Available in Mac OS X v10.5 and later.
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.EndTransparencyLayer
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.1 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
| 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 even-odd fill rule for deciding what's inside the path.
Some examples using this method:
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Some examples using this method:
CGContextMBS.FillEllipseInRect(rect as CGRectMBS)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.0 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Requires Mac OS X 10.4.
Some examples using this method:
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.FillRect(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.
CGContextMBS.fillRoundedRect(x as Double, y as Double, w as Double, h as Double, arcWidth as Double, arcHeight as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Like UpdateNow in the RB window class.
CGContextMBS.frameArc(x as Double, y as Double, w as Double, h as Double, startAngle as Integer, arcAngle as Integer)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
angles are in degree.
CGContextMBS.frameOval(x as Double, y as Double, w as Double, h as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.frameRect(x as Double, y as Double, w as Double, h as Double)
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 8.4 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Some examples using this method:
CGContextMBS.GetClipBoundingBox as CGRectMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 11.2 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns the bounding box of the clipping path, specified in user space.
The bounding box is the smallest rectangle completely enclosing all points in the clipping path, including control points for any Bezier curves in the path.
Available in Mac OS X v10.3 and later.
CGContextMBS.GetCTM as CGAffineTransformMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 4.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on any error.
CGContextMBS.GetPathBoundingBox as CGRectMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
The bounding box is the smallest rectangle completely enclosing all points in the path, including control points for Bezier and quadratic curves.
CGContextMBS.GetPathCurrentPoint as CGPointMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 2.7 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
CGContextMBS.GetTextPosition as CGPointMBS
| Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
| method | CoreGraphics | MBS MacCG Plugin | 4.3 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
Returns nil on any problem.
The items on this page are in the following plugins: MBS MacCG Plugin.