# GraphicsPath

## Content

# Class: GraphicsPath

Represents a path for drawing, filling, or clipping.

## Extends

- [`ObjectBase`](ObjectBase)

## Accessors

### figureHasSegments

#### Get Signature

```ts
get figureHasSegments(): boolean;
```

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

##### Returns

`boolean`

***

### figureStarted

#### Get Signature

```ts
get figureStarted(): boolean;
```

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

##### Returns

`boolean`

***

### fillMode

#### Get Signature

```ts
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`](../enumerations/FillMode)

#### Set Signature

```ts
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`](../enumerations/FillMode)

##### Returns

`void`

***

### id

#### Get Signature

```ts
get id(): number;
```

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`ObjectBase`](ObjectBase).[`id`](ObjectBase#id)

***

### isClosed

#### Get Signature

```ts
get isClosed(): boolean;
```

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

##### Returns

`boolean`

***

### om

#### Get Signature

```ts
get om(): ObjectManager;
```

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`ObjectBase`](ObjectBase).[`om`](ObjectBase#om)

## Methods

### addArc()

```ts
addArc(arcProperties): void;
```

Adds a single arc to the path geometry.

#### Parameters

##### arcProperties

[`ArcSegmentProperties`](../type-aliases/ArcSegmentProperties)

The arc segment to add to the figure.

#### Returns

`void`

***

### addBezier()

```ts
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

```ts
addEllipse(
   x, 
   y, 
   width, 
   height): void;
```

Adds an ellipse figure to the path.
Note! The method calls the [GraphicsPath#beginFigure](#beginfigure) and [GraphicsPath#endFigure](#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

```ts
addEllipse(bounds): void;
```

Adds an ellipse figure to the path.
Note! The method calls the [GraphicsPath#beginFigure](#beginfigure) and [GraphicsPath#endFigure](#endfigure) methods.

##### Parameters

###### bounds

[`Bounds`](../type-aliases/Bounds)

The ellipse's bounds.

##### Returns

`void`

***

### addLine()

```ts
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()

```ts
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

```ts
addRect(
   x, 
   y, 
   width, 
   height): void;
```

Adds a rectangular figure to the path.
Note! The method calls the [GraphicsPath#beginFigure](#beginfigure) and [GraphicsPath#endFigure](#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

```ts
addRect(bounds): void;
```

Adds a rectangular figure to the path.
Note! The method calls the [GraphicsPath#beginFigure](#beginfigure) and [GraphicsPath#endFigure](#endfigure) methods.

##### Parameters

###### bounds

[`Bounds`](../type-aliases/Bounds)

The rectangle bounds.

##### Returns

`void`

***

### beginFigure()

```ts
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()

```ts
cancelFigure(): void;
```

Discards the active figure.

#### Returns

`void`

***

### close()

```ts
close(): void;
```

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

#### Returns

`void`

***

### endFigure()

```ts
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](#beginfigure).

#### Returns

`void`

***

### free()

```ts
free(): void;
```

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`free`](ObjectBase#free)

***

### getBounds()

```ts
getBounds(transform?): Rect;
```

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

#### Parameters

##### transform?

[`Transform`](Transform)

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

#### Returns

[`Rect`](../type-aliases/Rect)

A rectangle that bounds this path.

***

### rebind()

```ts
rebind(omTo): void;
```

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`ObjectBase`](ObjectBase).[`rebind`](ObjectBase#rebind)
