Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSBezierPathMBS class.

NSBezierPathMBS.appendBezierPath(path as NSBezierPathMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends the contents of the specified path object to the receiver's path.

Path: The path to add to the receiver.

This method adds the commands used to create aPath to the end of the receiver's path. This method does not explicitly try to connect the subpaths in the two objects, although the operations in Path may still cause that effect.

NSBezierPathMBS.appendBezierPathWithArc(center as NSPointMBS, radius as Double, startAngle as Double, endAngle as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends an arc of a circle to the receiver's path.

center: Specifies the center point of the circle used to define the arc.
radius: Specifies the radius of the circle used to define the arc.
startAngle: Specifies the starting angle of the arc, measured in degrees counterclockwise from the x-axis.
endAngle: Specifies the end angle of the arc, measured in degrees counterclockwise from the x-axis.

The created arc lies on the perimeter of the circle, between the angles specified by the startAngle and endAngle parameters. The arc is drawn in a counterclockwise direction. If the receiver's path is empty, this method sets the current point to the beginning of the arc before adding the arc segment. If the receiver's path is not empty, a line is drawn from the current point to the starting point of the arc.

Depending on the length of the arc, this method may add multiple connected curve segments to the path.

See also:

NSBezierPathMBS.appendBezierPathWithArc(center as NSPointMBS, radius as Double, startAngle as Double, endAngle as Double, clockwise as boolean)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends an arc of a circle to the receiver's path.

center: Specifies the center point of the circle used to define the arc.
radius: Specifies the radius of the circle used to define the arc.
startAngle: Specifies the starting angle of the arc, measured in degrees counterclockwise from the x-axis.
endAngle: Specifies the end angle of the arc, measured in degrees counterclockwise from the x-axis.
clockwise: true if you want the arc to be drawn in a clockwise direction; otherwise false to draw the arc in a counterclockwise direction.

The created arc lies on the perimeter of the circle, between the angles specified by the startAngle and endAngle parameters. The arc is drawn in the direction indicated by the clockwise parameter. If the receiver's path is empty, this method sets the current point to the beginning of the arc before adding the arc segment. If the receiver's path is not empty, a line is drawn from the current point to the starting point of the arc.

Depending on the length of the arc, this method may add multiple connected curve segments to the path.

See also:

NSBezierPathMBS.appendBezierPathWithArc(point1 as NSPointMBS, point2 as NSPointMBS, radius as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends an arc to the receiver's path.

point1: The middle point of the angle.
point2: The end point of the angle.
radius: The radius of the circle inscribed in the angle.

The created arc is defined by a circle inscribed inside the angle specified by three points: the current point, the fromPoint parameter, and the toPoint parameter (in that order). The arc itself lies on the perimeter of the circle, whose radius is specified by the radius parameter. The arc is drawn between the two points of the circle that are tangent to the two legs of the angle.

The arc usually does not contain the points in the fromPoint and toPoint parameters. If the starting point of the arc does not coincide with the current point, a line is drawn between the two points. The starting point of the arc lies on the line defined by the current point and the fromPoint parameter.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

Depending on the length of the arc, this method may add multiple connected curve segments to the path.

See also:

NSBezierPathMBS.appendBezierPathWithGlyph(glyph as Integer, font as NSFontMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends an outline of the specified glyph to the receiver's path.

Glyph: The glyph to add to the path.
font: The font in which the glyph is encoded.

If the glyph is not encoded in the font specified by the font parameter—that is, the font does not have an entry for the specified glyph—then no path is appended to the receiver.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.appendBezierPathWithGlyphs(glyphs() as Integer, font as NSFontMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends the outlines of the specified glyphs to the receiver's path.

glyphs: An array of glpyhs to add to the path.
count: The number of glyphs in the glyphs parameter.
font: The font in which the glyphs are encoded.

If the glyphs are not encoded in the font specified by the font parameter—that is, the font does not have an entry for one of the specified glyphs—then no path is appended to the receiver.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.appendBezierPathWithOvalInRect(rect as NSRectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends an oval path to the receiver, inscribing the oval in the specified rectangle.

rect: The rectangle in which to inscribe the oval.

Before adding the oval, this method moves the current point, which implicitly closes the current subpath. If the aRect parameter specifies a square, the inscribed path is a circle. The path is constructed by starting in the lower-right quadrant of the rectangle and adding arc segments counterclockwise to complete the oval.

NSBezierPathMBS.appendBezierPathWithPoints(points() as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends a series of line segments to the receiver's path.

points: An array of NSPoint data types, each of which contains the end point of the next line segment.
count :The number of points in the points parameter.

This method interprets the points as a set of connected line segments. If the current path contains an open subpath, a line is created from the last point in that subpath to the first point in the points array. If the current path is empty, the first point in the points array is used to set the starting point of the line segments. Subsequent line segments are added using the remaining points in the array.

This method does not close the path that is created. If you wish to create a closed path, you must do so by explicitly invoking the receiver's closePath method.

NSBezierPathMBS.appendBezierPathWithRect(rect as NSRectMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends a rectangular path to the receiver's path.

rect: The rectangle describing the path to create.

Before adding the rectangle, this method moves the current point to the origin of the rectangle, which implicitly closes the current subpath (if any). The path is constructed by starting at the origin of aRect and adding line segments in a counterclockwise direction. The final segment is added using a closePath message.

NSBezierPathMBS.appendBezierPathWithRoundedRect(rect as NSRectMBS, xRadius as Double, yRadius as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends a rounded rectangular path to the receiver's path.

rect: The rectangle that defines the basic shape of the path.
xRadius: The radius of each corner oval along the x-axis. Values larger than half the rectangle's width are clamped to half the width.
yRadius: The radius of each corner oval along the y-axis. Values larger than half the rectangle's height are clamped to half the height.

The path is constructed in a counter-clockwise direction, starting at the top-left corner of the rectangle. If either one of the radius parameters contains the value 0.0, the returned path is a plain rectangle without rounded corners.

NSBezierPathMBS.bezierPathByFlatteningPath as NSBezierPathMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Creates and returns a "flattened" copy of the receiver.

Returns a new path object whose contents are a flattened version of the receiver's path.

Flattening a path converts all curved line segments into straight line approximations. The granularity of the approximations is controlled by the path's current flatness value, which is set using the DefaultFlatness property.

NSBezierPathMBS.bezierPathByReversingPath as NSBezierPathMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates and returns a new NSBezierPath object with the reversed contents of the receiver's path.

Returns a new path object whose contents are a reversed version of the receiver's path.

Reversing a path does not necessarily change the appearance of the path when rendered. Instead, it changes the direction in which path segments are drawn. For example, reversing the path of a rectangle (whose line segments are normally drawn starting at the origin and proceeding in a counterclockwise direction) causes its line segments to be drawn in a clockwise direction instead. Drawing a reversed path could affect the appearance of a filled pattern, depending on the pattern and the fill rule in use.

This method reverses each whole or partial subpath in the path object individually.

NSBezierPathMBS.closePath

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Closes the most recently added subpath.

This method closes the current subpath by creating a line segment between the first and last points in the subpath. This method subsequently updates the current point to the end of the newly created line segment, which is also the first point in the now closed subpath.

NSBezierPathMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Initializes a new empty NSBezierPath object.

NSBezierPathMBS.containsPoint(p as NSPointMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value indicating whether the receiver contains the specified point.
Example
dim r as new NSRectMBS(10, 10, 50, 50)
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPathWithRect(r)
dim p as new NSPointMBS(20,20)

MsgBox str(b.containsPoint(p))

p: The point to test against the path, specified in the path object's coordinate system.

Returns true if the path's enclosed area contains the specified point; otherwise, false.

This method checks the point against the path itself and the area it encloses. When determining hits in the enclosed area, this method uses the non-zero winding rule (NSNonZeroWindingRule). It does not take into account the line width used to stroke the path.

NSBezierPathMBS.copy as NSBezierPathMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the bezier path.

NSBezierPathMBS.curveToPoint(endPoint as NSPointMBS, controlPoint1 as NSPointMBS, controlPoint2 as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds a Bezier cubic curve to the receiver's path.

endPoint: The destination point of the curve segment, specified in the current coordinate system
controlPoint1: The point that determines the shape of the curve near the current point.
controlPoint2: The point that determines the shape of the curve near the destination point.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.elementAtIndex(index as Integer) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the type of path element at the specified index.

index: The index of the desired path element.

Returns the type of the path element.
Path elements describe the commands used to define a path and include basic commands such as moving to a specific point, creating a line segment, creating a curve, or closing the path. The elements are stored in the order of their execution.

See also:

NSBezierPathMBS.elementAtIndex(index as Integer, byref associatedPoints() as NSPointMBS) as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Gets the element type and (and optionally) the associated points for the path element at the specified index.

index: The index of the desired path element.
associatedPoints: On output, the data points associated with the specified path element.

Returns the type of the path element.

For curve operations, the order of the points is controlPoint1 (associatedPoints(0)), controlPoint2 (associatedPoints(1)), endPoint (associatedPoints(2)).

See also:

NSBezierPathMBS.elementCount as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the total number of path elements in the receiver's path.
Example
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPath

b.moveToPoint NSMakePointMBS(10, 10)
b.lineToPoint NSMakePointMBS(290, 290)
MsgBox str(b.elementCount) // 2

b.removeAllPoints
MsgBox str(b.elementCount) // 0

Each element type corresponds to one of the operations described in constants.

NSBezierPathMBS.flatness as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The flatness value of the path.

If no value is set, this method returns the default flatness value.
(Read and Write computed property)

NSBezierPathMBS.getLineDash(byref pattern() as Double, byref count as Integer, byref phase as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns the line-stroking pattern for the receiver.

pattern: On output, this array contains the lengths (measured in points) of the line segments and gaps in the pattern. The values in the array alternate, starting with the first line segment length, followed by the first gap length, followed by the second line segment length, and so on.
count: On output, the number of entries written to pattern.
phase: On output, this value contains the offset at which to start drawing the pattern, measured in points along the dashed-line pattern. For example, a phase of 6 in the pattern 5-2-3-2 would cause drawing to begin in the middle of the first gap.

NSBezierPathMBS.isEmpty as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value indicating whether the receiver is empty.
Example
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPath
MsgBox "isEmpty: "+str(b.isEmpty)

True if the receiver contains no path elements; otherwise, false.

NSBezierPathMBS.lineCapStyle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The line cap style for the receiver's path.

If this value is not set for the receiver, the default line cap style is returned.
(Read and Write computed property)

NSBezierPathMBS.lineJoinStyle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The receiver's line join style.

If this value is not set for the receiver, the default line join style is returned.
(Read and Write computed property)

NSBezierPathMBS.lineToPoint(p as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends a straight line to the receiver's path.

p: The destination point of the line segment, specified in the current coordinate system.

This method creates a straight line segment starting at the current point and ending at the point specified by the aPoint parameter. The current point is the last point in the receiver's most recently added segment.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.lineWidth as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The line width of the receiver's path.
Example
dim n as new NSImageMBS(300, 300)
dim g as new NSGraphicsMBS(n)

g.setFillColor NSColorMBS.redColor

dim r as NSRectMBS = NSMakeRectMBS(50, 50, 100, 100)
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPath

b.moveToPoint NSMakePointMBS(10, 10)
b.lineToPoint NSMakePointMBS(290, 290)

dim pattern() as Double
pattern.Append 10
pattern.Append 4

b.lineWidth = 5
b.setLineDash pattern, 12

g.stroke(b)

g = nil

window1.Backdrop = n.CopyPicture // red line with dash pattern

The line width of the receiver, measured in points in the user coordinate space.
If no value was set explicitly for the receiver, this method returns the default line width.
(Read and Write computed property)

NSBezierPathMBS.miterLimit as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
The miter limit of the receiver's path.

If no value is set, this method returns the default miter limit.
(Read and Write computed property)

NSBezierPathMBS.moveToPoint(p as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Moves the receiver's current point to the specified location.

p: A point in the current coordinate system.

This method implicitly closes the current subpath (if any) and sets the current point to the value in p. When closing the previous subpath, this method does not cause a line to be created from the first and last points in the subpath.

For many path operations, you must invoke this method before issuing any commands that cause a line or curve segment to be drawn.

NSBezierPathMBS.relativeCurveToPoint(endPoint as NSPointMBS, controlPoint1 as NSPointMBS, controlPoint2 as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Adds a Bezier cubic curve to the receiver's path from the current point to a new location, which is specified as a relative distance from the current point.

endPoint: The destination point of the curve segment, interpreted as a relative offset from the current point.
controlPoint1: The point that determines the shape of the curve near the current point, interpreted as a relative offset from the current point.
controlPoint2: The point that determines the shape of the curve near the destination point, interpreted as a relative offset from the current point.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.relativeLineToPoint(p as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Appends a straight line segment to the receiver's path starting at the current point and moving towards the specified point, relative to the current location.

p: A point whose coordinates are interpreted as a relative offset from the current point.

The destination point is relative to the current point. For example, if the current point is (1, 1) and aPoint contains the value (1, 2), a line segment is created between the points (1, 1) and (2, 3).

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.relativeMoveToPoint(p as NSPointMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Moves the receiver's current point to a new point whose location is the specified distance from the current point.

p: A point whose coordinates are interpreted as a relative offset from the current point.

This method implicitly closes the current subpath (if any) and updates the location of the current point. For example, if the current point is (1, 1) and aPoint contains the value (1, 2), the previous subpath would be closed and the current point would become (2, 3). When closing the previous subpath, this method does not cause a line to be created from the first and last points in the subpath.

You must set the path's current point (using the moveToPoint method or through the creation of a preceding line or curve segment) before you invoke this method. If the path is empty, this method raises an NSGenericException exception.

NSBezierPathMBS.removeAllPoints

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Removes all path elements from the receiver, effectively clearing the path.
Example
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPath

b.moveToPoint NSMakePointMBS(10, 10)
b.lineToPoint NSMakePointMBS(290, 290)
MsgBox str(b.elementCount) // 2

b.removeAllPoints
MsgBox str(b.elementCount) // 0

NSBezierPathMBS.setAssociatedPoints(points() as NSPointMBS, index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Changes the points associated with the specified path element.

points: An array containing up to three NSPointMBS data types. This parameter must contain the correct number of points for the path element at the specified index. Move, close path, and line segment commands require one point. Curve operations require three points.
index: The index of the path element you want to modify.

You can use this method to change the points associated with a path quickly and without recreating the path. You cannot use this method to change the type of the path element.

The following example shows you how you would modify the point associated with a line path element. The path created by this example results in a path with two elements. The first path element specifies a move to point (0, 0) while the second creates a line to point (100, 100). It then changes the line to go only to the point (50,50) using this method:

Note: If you specify too few points for a path element of type NSCurveToBezierPathElement, the behavior of this method is undefined.

NSBezierPathMBS.setLineDash(pattern() as Double, phase as Double)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ✅ Yes All
Sets the line-stroking pattern for the receiver.
Example
dim n as new NSImageMBS(300, 300)
dim g as new NSGraphicsMBS(n)

g.setFillColor NSColorMBS.redColor

dim r as NSRectMBS = NSMakeRectMBS(50, 50, 100, 100)
dim b as NSBezierPathMBS = NSBezierPathMBS.bezierPath

b.moveToPoint NSMakePointMBS(10, 10)
b.lineToPoint NSMakePointMBS(290, 290)

dim pattern() as Double
pattern.Append 5
pattern.Append 2
b.setLineDash pattern, 6

g.stroke(b)

g = nil

window1.Backdrop = n.CopyPicture // red line with dash pattern

pattern: An array of floating point values that contains the lengths (measured in points) of the line segments and gaps in the pattern. The values in the array alternate, starting with the first line segment length, followed by the first gap length, followed by the second line segment length, and so on
count: The number of values in pattern.
phase: The offset at which to start drawing the pattern, measured in points along the dashed-line pattern. For example, a phase of 6 in the pattern 5-2-3-2 would cause drawing to begin in the middle of the first gap.

NSBezierPathMBS.transformUsingAffineTransform(transform as Variant)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Transforms all points in the receiver using the specified transform.
Example
dim bezierPath as NSBezierPathMBS = NSBezierPathMBS.bezierPath
dim transform as NSAffineTransformMBS = NSAffineTransformMBS.transform

bezierPath.moveToPoint NSMakePointMBS(0.0, 0.0)
bezierPath.lineToPoint NSMakePointMBS(100.0, 100.0)

transform.translate(10,10)
bezierPath.transformUsingAffineTransform(transform)

Break // bezierPath.bounds starts now at 10/10

Transform: The transform to apply to the path.

This method applies the transform to the path's points immediately. The following code translates a line from 0,0 to 100,100 to a line from 10,10 to 110,110.

transform must be a NSAffineTransformMBS object.

NSBezierPathMBS.windingRule as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property Cocoa Drawing MBS MacBase Plugin 12.5 ✅ Yes ❌ No ❌ No ❌ No Desktop, Console & Web
Returns the winding rule used to fill the receiver's path.

Returns the winding rule for the path. This value may be either NSNonZeroWindingRule or NSEvenOddWindingRule.

This value overrides the default value returned by defaultWindingRule.
For more information on how winding rules affect the appearance of filled paths, see Constants.
(Read and Write computed property)

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


The biggest plugin in space...