Platforms to show: All Mac Windows Linux Cross-Platform
NSBezierPathMBS class
Type | Topic | Plugin | Version | macOS | Windows | Linux | iOS | Targets |
class | Cocoa Drawing | MBS MacBase Plugin | 12.5 | ✅ Yes | ❌ No | ❌ No | ✅ Yes | All |
An NSBezierPath object allows you to create paths using PostScript-style commands. Paths consist of straight and curved line segments joined together. Paths can form recognizable shapes such as rectangles, ovals, arcs, and glyphs; they can also form complex polygons using either straight or curved line segments. A single path can be closed by connecting its two endpoints, or it can be left open.
An NSBezierPath object can contain multiple disconnected paths, whether they are closed or open. Each of these paths is referred to as a subpath. The subpaths of an NSBezierPath object must be manipulated as a group. The only way to manipulate subpaths individually is to create separate NSBezierPath objects for each.
For a given NSBezierPath object, you can stroke the path's outline or fill the region occupied by the path. You can also use the path as a clipping region for views or other regions. Using methods of NSBezierPath, you can also perform hit detection on the filled or stroked path. Hit detection is needed to implement interactive graphics, as in rubberbanding and dragging operations.
The current graphics context is automatically saved and restored for all drawing operations involving NSBezierPath objects, so your application does not need to worry about the graphics settings changing across invocations.
- 10 properties
- property Bounds as NSRectMBS
- property ControlPointBounds as NSRectMBS
- property CurrentPoint as NSPointMBS
- property Handle as Integer
- property flatness as Double
- property lineCapStyle as Integer
- property lineJoinStyle as Integer
- property lineWidth as Double
- property miterLimit as Double
- property windingRule as Integer
- 6 shared properties
- shared property defaultFlatness as Double
- shared property defaultLineCapStyle as Integer
- shared property defaultLineJoinStyle as Integer
- shared property defaultLineWidth as Double
- shared property defaultMiterLimit as Double
- shared property defaultWindingRule as Integer
- 31 methods
- method appendBezierPath(path as NSBezierPathMBS)
- method appendBezierPathWithArc(center as NSPointMBS, radius as Double, startAngle as Double, endAngle as Double)
- method appendBezierPathWithArc(center as NSPointMBS, radius as Double, startAngle as Double, endAngle as Double, clockwise as boolean)
- method appendBezierPathWithArc(point1 as NSPointMBS, point2 as NSPointMBS, radius as Double)
- method appendBezierPathWithGlyph(glyph as Integer, font as NSFontMBS)
- method appendBezierPathWithGlyphs(glyphs() as Integer, font as NSFontMBS)
- method appendBezierPathWithOvalInRect(rect as NSRectMBS)
- method appendBezierPathWithPoints(points() as NSPointMBS)
- method appendBezierPathWithRect(rect as NSRectMBS)
- method appendBezierPathWithRoundedRect(rect as NSRectMBS, xRadius as Double, yRadius as Double)
- method bezierPathByFlatteningPath as NSBezierPathMBS
- method bezierPathByReversingPath as NSBezierPathMBS
- method closePath
- method Constructor
- method containsPoint(p as NSPointMBS) as boolean
- method copy as NSBezierPathMBS
- method curveToPoint(endPoint as NSPointMBS, controlPoint1 as NSPointMBS, controlPoint2 as NSPointMBS)
- method elementAtIndex(index as Integer) as Integer
- method elementAtIndex(index as Integer, byref associatedPoints() as NSPointMBS) as Integer
- method elementCount as Integer
- method getLineDash(byref pattern() as Double, byref count as Integer, byref phase as Double)
- method isEmpty as boolean
- method lineToPoint(p as NSPointMBS)
- method moveToPoint(p as NSPointMBS)
- method relativeCurveToPoint(endPoint as NSPointMBS, controlPoint1 as NSPointMBS, controlPoint2 as NSPointMBS)
- method relativeLineToPoint(p as NSPointMBS)
- method relativeMoveToPoint(p as NSPointMBS)
- method removeAllPoints
- method setAssociatedPoints(points() as NSPointMBS, index as Integer)
- method setLineDash(pattern() as Double, phase as Double)
- method transformUsingAffineTransform(transform as Variant)
- 4 shared methods
- shared method bezierPath as NSBezierPathMBS
- shared method bezierPathWithOvalInRect(r as NSRectMBS) as NSBezierPathMBS
- shared method bezierPathWithRect(r as NSRectMBS) as NSBezierPathMBS
- shared method bezierPathWithRoundedRect(r as NSRectMBS, xRadius as Double, yRadius as Double) as NSBezierPathMBS
- 12 constants
Line Joint Style Constants
Constant | Value | Description |
---|---|---|
NSBevelLineJoinStyle | 2 |
Specifies a bevel line shape of the joints between connected segments of a stroked path. See the setDefaultLineJoinStyle method for an example of the appearance. |
NSMiterLineJoinStyle | 0 |
Specifies a miter line shape of the joints between connected segments of a stroked path. See the setDefaultLineJoinStyle method for an example of the appearance. |
NSRoundLineJoinStyle | 1 |
Specifies a round line shape of the joints between connected segments of a stroked path. See the setDefaultLineJoinStyle method for an example of the appearance. |
Line Cap Style Constants
Constant | Value | Description |
---|---|---|
NSButtLineCapStyle | 0 |
Specifies a butt line cap style for endpoints for an open path when stroked. See the setDefaultLineCapStyle method for an example of the appearance. |
NSRoundLineCapStyle | 1 |
Specifies a round line cap style for endpoints for an open path when stroked. See the setDefaultLineCapStyle method for an example of the appearance. |
NSSquareLineCapStyle | 2 |
Specifies a square line cap style for endpoints for an open path when stroked. See the setDefaultLineCapStyle method for an example of the appearance. |
Path Element Command Constants
Constant | Value | Description |
---|---|---|
NSClosePathBezierPathElement | 3 |
Marks the end of the current subpath at the specified point. Note that the point specified for the Close Path element is essentially the same as the current point. |
NSCurveToBezierPathElement | 2 | Creates a curved line segment from the current point to the specified endpoint using two control points to define the curve. more |
NSLineToBezierPathElement | 1 |
Creates a straight line from the current drawing point to the specified point. Lines and rectangles are specified using this path element. Contains 1 point. |
NSMoveToBezierPathElement | 0 | Moves the path object's current drawing point to the specified point. more |
Window Rule Constants
Constant | Value | Description |
---|---|---|
NSEvenOddWindingRule | 1 | Specifies the even-odd winding rule. more |
NSNonZeroWindingRule | 0 | Specifies the non-zero winding rule. more |
This class has no sub classes.
Some methods using this class:
- NSGraphicsMBS.addClip(path as NSBezierPathMBS)
- NSGraphicsMBS.setClip(path as NSBezierPathMBS)
- NSGraphicsMBS.stroke(path as NSBezierPathMBS)
- PDFAnnotationInkMBS.addBezierPath(path as NSBezierPathMBS)
- PDFAnnotationInkMBS.paths as NSBezierPathMBS()
- PDFAnnotationMBS.addBezierPath(path as NSBezierPathMBS)
- PDFAnnotationMBS.paths as NSBezierPathMBS()
- PDFAnnotationMBS.removeBezierPath(path as NSBezierPathMBS)
- SCNShapeMBS.Constructor(path as NSBezierPathMBS, extrusionDepth as double)
- SCNShapeMBS.shape(path as NSBezierPathMBS, extrusionDepth as double) as SCNShapeMBS
Some properties using for this class:
- SCNShapeMBS.chamferProfile as NSBezierPathMBS
- SCNShapeMBS.path as NSBezierPathMBS
- SCNTextMBS.chamferProfile as NSBezierPathMBS
Some examples using this class:
Blog Entries
The items on this page are in the following plugins: MBS MacBase Plugin.
NSAutoreleasePoolMBS - NSBitmapImageRepMBS