Class ClipPathBuilder

Class ClipPathBuilder

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

A builder class for constructing CSS clip-path values. This class provides methods to define clip paths using basic shapes, external references, or geometry boxes. It allows for the creation of complex clipping paths in a structured and readable manner.

[ComVisible(true)]
public class ClipPathBuilder

Inheritance

object ClipPathBuilder

Inherited Members

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

Constructors

ClipPathBuilder()

public ClipPathBuilder()

Methods

Build()

Builds the clip path value as a string.

public string Build()

Returns

string

A string representation of the clip path.

Circle(double, double, double, LengthType)

Defines a circular clip path.

public ClipPathBuilder Circle(double radius, double centerX, double centerY, LengthType type = LengthType.Px)

Parameters

radius double

Radius of the circle.

centerX double

X-coordinate of the circle’s center.

centerY double

Y-coordinate of the circle’s center.

type LengthType

The unit type for the dimensions.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

ClipSourceId(string)

Sets the clip path to reference an external source.

public ClipPathBuilder ClipSourceId(string clipSourceId)

Parameters

clipSourceId string

The ID of the external source to reference.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

Ellipse(double, double, double, double, LengthType)

Defines an elliptical clip path.

public ClipPathBuilder Ellipse(double radiusX, double radiusY, double centerX, double centerY, LengthType type = LengthType.Px)

Parameters

radiusX double

Horizontal radius of the ellipse.

radiusY double

Vertical radius of the ellipse.

centerX double

X-coordinate of the ellipse’s center.

centerY double

Y-coordinate of the ellipse’s center.

type LengthType

The unit type for the dimensions.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

GeometryBox(GeometryBox)

Sets the geometry box for the clip path.

public ClipPathBuilder GeometryBox(GeometryBox box)

Parameters

box GeometryBox

The geometry box to use.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

None()

Sets the clip path to ’none’, effectively disabling clipping.

public ClipPathBuilder None()

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

Polygon(params double[])

Defines a polygonal clip path.

public ClipPathBuilder Polygon(params double[] points)

Parameters

points double []

An array of points defining the vertices of the polygon.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

Rectangle(double, double, double, double, double, double, LengthType)

Defines a rectangular clip path with optional rounded corners.

public ClipPathBuilder Rectangle(double x, double y, double width, double height, double rx = 0, double ry = 0, LengthType type = LengthType.Px)

Parameters

x double

X-coordinate of the top-left corner of the rectangle.

y double

Y-coordinate of the top-left corner of the rectangle.

width double

Width of the rectangle.

height double

Height of the rectangle.

rx double

Horizontal radius of the corners.

ry double

Vertical radius of the corners.

type LengthType

The unit type for the dimensions.

Returns

ClipPathBuilder

The current instance of ClipPathBuilder for method chaining.

 English