[]
        
(Showing Draft Content)

GraphicsPath

DsPdfJS API v9.1.0


DsPdfJS API / GraphicsPath

Class: GraphicsPath

Represents a path for drawing, filling, or clipping.

Extends

Accessors

figureHasSegments

Get Signature

get figureHasSegments(): boolean

Gets a value indicating if the active figure contains one or more segments.

Returns

boolean


figureStarted

Get Signature

get figureStarted(): boolean

Gets a value indicating if there is an active figure to update.

Returns

boolean


fillMode

Get Signature

get fillMode(): FillMode

Gets or sets the method used to determine which points are inside the geometry described by this GraphicsPath and which points are outside.

Returns

FillMode

Set Signature

set fillMode(fillMode): void

Gets or sets the method used to determine which points are inside the geometry described by this GraphicsPath and which points are outside.

Parameters
fillMode

FillMode

Returns

void


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

ObjectBase.id


isClosed

Get Signature

get isClosed(): boolean

Gets a value indicating if the path is closed for subsequent modifications.

Returns

boolean


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

ObjectBase.om

Methods

addArc()

addArc(arcProperties): void

Adds a single arc to the path geometry.

Parameters

arcProperties

ArcSegmentProperties

The arc segment to add to the figure.

Returns

void


addBezier()

addBezier(xP1, yP1, xP2, yP2, xEndPoint, yEndPoint): void

Creates a cubic Bezier curve between the current point and the specified end point.

Parameters

xP1

number

The X coordinate of the first control point for the Bezier segment.

yP1

number

The Y coordinate of the first control point for the Bezier segment.

xP2

number

The X coordinate of the second control point for the Bezier segment.

yP2

number

The Y coordinate of the second control point for the Bezier segment.

xEndPoint

number

The X coordinate of the end point for the Bezier segment.

yEndPoint

number

The Y coordinate of the end point for the Bezier segment.

Returns

void


addEllipse()

Call Signature

addEllipse(x, y, width, height): void

Adds an ellipse figure to the path. Note! The method calls the GraphicsPath#beginFigure and GraphicsPath#endFigure methods.

Parameters
x

number

The X coordinate of the rectangle enclosing an ellipse.

y

number

The Y coordinate of the rectangle enclosing an ellipse.

width

number

The width of the rectangle enclosing an ellipse.

height

number

The height of the rectangle enclosing an ellipse.

Returns

void

Call Signature

addEllipse(bounds): void

Adds an ellipse figure to the path. Note! The method calls the GraphicsPath#beginFigure and GraphicsPath#endFigure methods.

Parameters
bounds

Bounds

The ellipse's bounds.

Returns

void


addLine()

addLine(x, y): void

Creates a line segment between the current point and the specified end point.

Parameters

x

number

The X coordinate of the end point of the line to draw.

y

number

The Y coordinate of the end point of the line to draw.

Returns

void


addQuadraticBezier()

addQuadraticBezier(xP1, yP1, xEndPoint, yEndPoint): void

Creates a quadratic Bezier curve between the current point and the specified end point.

Parameters

xP1

number

The X coordinate of the control point for the quadratic Bezier segment.

yP1

number

The Y coordinate of the control point for the quadratic Bezier segment.

xEndPoint

number

The X coordinate of the end point for the quadratic Bezier segment.

yEndPoint

number

The Y coordinate of the end point for the quadratic Bezier segment.

Returns

void


addRect()

Call Signature

addRect(x, y, width, height): void

Adds a rectangular figure to the path. Note! The method calls the GraphicsPath#beginFigure and GraphicsPath#endFigure methods.

Parameters
x

number

The X coordinate of the rectangle.

y

number

The Y coordinate of the rectangle.

width

number

The width of the rectangle.

height

number

The height of the rectangle.

Returns

void

Call Signature

addRect(bounds): void

Adds a rectangular figure to the path. Note! The method calls the GraphicsPath#beginFigure and GraphicsPath#endFigure methods.

Parameters
bounds

Bounds

The rectangle bounds.

Returns

void


beginFigure()

beginFigure(x, y): void

Starts a new figure at the specified point.

Parameters

x

number

The X coordinate at which to begin the new figure.

y

number

The Y coordinate at which to begin the new figure.

Returns

void


cancelFigure()

cancelFigure(): void

Discards the active figure.

Returns

void


close()

close(): void

Closes the path for modifications. The path cannot be modified after it is closed.

Returns

void


endFigure()

endFigure(closeFigure): void

Ends the current figure; optionally, closes it.

Parameters

closeFigure

boolean

A value that indicates whether the current figure is closed. If the figure is closed, a line is drawn between the current point and the start point specified by GraphicsPath#beginFigure.

Returns

void


free()

free(): void

Detaches the object from the ObjectManager and deallocates its memory, if possible.

Returns

void

Inherited from

ObjectBase.free


getBounds()

getBounds(transform?): Rect

Returns a rectangle that bounds this GraphicsPath when it is transformed by the specified Transform.

Parameters

transform?

The transform to apply to this path before calculating its bounds.

Transform | null

Returns

Rect

A rectangle that bounds this path.


rebind()

rebind(omTo): void

Rebinds the object from the current ObjectManager to the specified one.

Parameters

omTo

ObjectManager

The new ObjectManager for the object.

Returns

void

Inherited from

ObjectBase.rebind