[]
        
(Showing Draft Content)

LinearGradientBrush

DsPdfJS API v9.1.0


DsPdfJS API / LinearGradientBrush

Class: LinearGradientBrush

Represents a linear gradient brush.

Extends

Constructors

Constructor

new LinearGradientBrush(linearGradientBrushProperties): LinearGradientBrush

Creates a linear gradient brush with specified properties.

Parameters

linearGradientBrushProperties

LinearGradientBrushProperties

The settings for creating a linear gradient brush.

Returns

LinearGradientBrush

Example

const brush = new LinearGradientBrush({
    startColor: "ForestGreen",
    startPoint: { x: 0, y: 0 },
    endColor: "Yellow",
    endPoint: { x: 1, y: 0 }
});

Overrides

Brush.constructor

Constructor

new LinearGradientBrush(om, linearGradientBrushProperties): LinearGradientBrush

Creates a linear gradient brush with specified properties.

Parameters

om

ObjectManager

An object manager that controls the lifetime of the LinearGradientBrush object.

linearGradientBrushProperties

LinearGradientBrushProperties

The settings for creating a linear gradient brush.

Returns

LinearGradientBrush

Overrides

Brush.constructor

Accessors

endColor

Get Signature

get endColor(): Color

Gets the ending gradient color.

Returns

Color


endPoint

Get Signature

get endPoint(): Point

Gets the end point of the linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner.

Returns

Point


gradientStops

Get Signature

get gradientStops(): GradientStop[] | null

Gets the array of gradient stops.

Returns

GradientStop[] | null


id

Get Signature

get id(): number

Gets the reference to the object.

Returns

number

Inherited from

Brush.id


om

Get Signature

get om(): ObjectManager

Gets the owner ObjectManager instance.

Returns

ObjectManager

Inherited from

Brush.om


startColor

Get Signature

get startColor(): Color

Gets the starting gradient color.

Returns

Color


startPoint

Get Signature

get startPoint(): Point

Gets the start point of the linear gradient brush. (0, 0) is the top-left corner, (1, 1) is the bottom-right corner.

Returns

Point


type

Get Signature

get type(): BrushType

Gets the type of the brush.

Returns

BrushType

Overrides

Brush.type

Methods

free()

free(): void

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

Returns

void

Inherited from

Brush.free


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

Brush.rebind