Platforms to show: All Mac Windows Linux Cross-Platform

Back to CGContextMBS class.

CGContextMBS.AddArc(x as Double, y as Double, radius as Double, startangle as Double, endangle as Double, clockwise as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Add an arc to the current path.
Example
const r=100.0
dim c as CGContextMBS
// draws a circle with radius r
c.BeginPath
c.SetLineWidth 5
c.SetGrayStrokeColor 0,1
c.AddArc 250,150,r,0,360,false
c.StrokePath

Add an arc of a circle to the context's path, possibly preceded by a straight line segment. '(x, y)' is the center of the arc; 'radius' is its radius; 'startAngle' is the angle to the first endpoint of the arc; 'endAngle' is the angle to the second endpoint of the arc; and 'clockwise' is true if the arc is to be drawn clockwise, false otherwise. 'startAngle' and 'endAngle' are measured in radians.

CGContextMBS.AddArcToPoint(x1 as Double, y1 as Double, x2 as Double, y2 as Double, radius as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Add an arc to the current path.

Add an arc of a circle to the context's path, possibly preceded by a straight line segment. 'radius' is the radius of the arc. The arc is tangent to the line from the current point to '(x1, y1)', and the line from '(x1, y1)' to '(x2, y2)'.

CGContextMBS.AddCurveToPoint(cp1x as Double, cp1y as Double, cp2x as Double, cp2y as Double, x as Double, y as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Append a cubic Bezier curve from the current point to (x,y), with control points (cp1x, cp1y) and (cp2x, cp2y)

CGContextMBS.AddLines(p() as CGPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Add a set of lines to the context's path.

Currently this function is not available to RB versions before 3.5.
Note that the p parameter is an array of CGPointMBS and not just one.

Some examples using this method:

CGContextMBS.AddLineToPoint(x as Double, y as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Append a straight line segment from the current point to (x, y).
Example
dim c as CGContextMBS

c=window1.CGContextMBS

c.SetRGBStrokeColor 1,0,0,1
c.BeginPath
c.MoveToPoint 0,0
c.AddLineToPoint 100,100
c.StrokePath
c.Flush

CGContextMBS.AddQuadCurveToPoint(cpx as Double, cpy as Double, x as Double, y as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Append a quadratic curve from the current point to (x, y), with control point (cpx, cpy).

CGContextMBS.AddRect(r as CGRectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Add a double rect to the context's path.

CGContextMBS.AddRects(r() as CGRectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method CoreGraphics MBS MacCG Plugin 2.7 ✅ Yes ❌ No ❌ No ✅ Yes All
Add a set of rects to the context's path.

Currently this function is not available to RB versions before 3.5.
Note that the r parameter is an array of CGRectMBS and not just one.

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


The biggest plugin in space...