Class MaskBuilder

Class MaskBuilder

Namespace: Aspose.Svg.Builder
Assembly: Aspose.SVG.dll (25.5.0)

A builder class for creating CSS mask properties. This class allows for the construction of complex mask styles using various properties such as mask source, position, size, repeat style, and more. The resulting string can be used in CSS to define the masking behavior of an element.

[ComVisible(true)]
public class MaskBuilder

Inheritance

object MaskBuilder

Inherited Members

object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()

Constructors

MaskBuilder()

public MaskBuilder()

Methods

BackgroundSize(double, double, LengthType)

Sets the background size for the mask.

public MaskBuilder BackgroundSize(double width, double height, LengthType type = LengthType.Px)

Parameters

width double

Width of the background.

height double

Height of the background.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

Build()

Builds the mask property value as a string.

public string Build()

Returns

string

A string representation of the mask property, suitable for use in CSS.

CompositingOperator(CompositingOperator)

Sets the compositing operator for the mask.

public MaskBuilder CompositingOperator(CompositingOperator op)

Parameters

op CompositingOperator

The compositing operator.

Returns

MaskBuilder

The current instance of MaskBuilder.

GeometryBox(GeometryBox)

Sets the geometry box of the mask.

public MaskBuilder GeometryBox(GeometryBox box)

Parameters

box GeometryBox

The geometry box.

Returns

MaskBuilder

The current instance of MaskBuilder.

GeometryBoxNoclip(GeometryBox)

Sets the geometry box of the mask with no clipping.

public MaskBuilder GeometryBoxNoclip(GeometryBox box)

Parameters

box GeometryBox

The geometry box.

Returns

MaskBuilder

The current instance of MaskBuilder.

MaskSourceId(string)

Sets the mask source ID for the mask.

public MaskBuilder MaskSourceId(string maskSourceId)

Parameters

maskSourceId string

The ID of the mask source element.

Returns

MaskBuilder

The current instance of MaskBuilder.

Exceptions

ArgumentException

Thrown when maskSourceId is null or whitespace.

Position(double, LengthType)

Sets the position of the mask.

public MaskBuilder Position(double position, LengthType type = LengthType.Px)

Parameters

position double

The position value.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

Position(double, double, LengthType)

Sets the position of the mask using horizontal and vertical values.

public MaskBuilder Position(double horizontal, double vertical, LengthType type = LengthType.Px)

Parameters

horizontal double

The horizontal position value.

vertical double

The vertical position value.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

Position(HorizontalPosition, double, LengthType)

Sets the position of the mask using a predefined horizontal position and a vertical value.

public MaskBuilder Position(HorizontalPosition horizontal, double vertical, LengthType type = LengthType.Px)

Parameters

horizontal HorizontalPosition

The predefined horizontal position.

vertical double

The vertical position value.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

Position(VerticalPosition, double, LengthType)

Sets the position of the mask using a predefined vertical position and a horizontal value.

public MaskBuilder Position(VerticalPosition vertical, double horizontal, LengthType type = LengthType.Px)

Parameters

vertical VerticalPosition

The predefined vertical position.

horizontal double

The horizontal position value.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

Position(HorizontalPosition, VerticalPosition)

Sets the position of the mask using predefined horizontal and vertical positions.

public MaskBuilder Position(HorizontalPosition horizontal, VerticalPosition vertical)

Parameters

horizontal HorizontalPosition

The predefined horizontal position.

vertical VerticalPosition

The predefined vertical position.

Returns

MaskBuilder

The current instance of MaskBuilder.

Position(HorizontalEdge, double, VerticalEdge, double, LengthType)

Sets the position of the mask using edges and values.

public MaskBuilder Position(HorizontalEdge horizontalEdge, double horizontalValue, VerticalEdge verticalEdge, double verticalValue, LengthType type = LengthType.Px)

Parameters

horizontalEdge HorizontalEdge

The horizontal edge position.

horizontalValue double

The horizontal position value.

verticalEdge VerticalEdge

The vertical edge position.

verticalValue double

The vertical position value.

type LengthType

The type of length measurement.

Returns

MaskBuilder

The current instance of MaskBuilder.

RepeatStyle(RepeatStyle)

Sets the repeat style of the mask.

public MaskBuilder RepeatStyle(RepeatStyle style)

Parameters

style RepeatStyle

The repeat style.

Returns

MaskBuilder

The current instance of MaskBuilder.

 English