Back to top OpenSVG (c) Veridict AB, www.veridict.com
Edit this page

Class Path

Represents a graphical path

Inheritance
object
Path
Implements
IEquatable<Path>
IDisposable
Inherited Members
object.Equals(object, object)
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: OpenSvg
Assembly: OpenSvg.dll
Syntax
public class Path : IEquatable<Path>, IDisposable

Constructors

| Edit this page View Source

Path()

Represents a graphical path with various drawing commands.

Declaration
public Path()
| Edit this page View Source

Path(SKPath)

Initializes a new instance of the Path class with the specified SKPath object.

Declaration
public Path(SKPath path)
Parameters
Type Name Description
SKPath path

The SKPath object to initialize the Path with.

Properties

| Edit this page View Source

BoundingBox

Declaration
public BoundingBox BoundingBox { get; }
Property Value
Type Description
BoundingBox
| Edit this page View Source

ConvexHull

Declaration
public ConvexHull ConvexHull { get; }
Property Value
Type Description
ConvexHull

Methods

| Edit this page View Source

ApproximatePathToPolygons(int)

Approximates the path to a collection of polygons.

Declaration
public IEnumerable<Polygon> ApproximatePathToPolygons(int segments)
Parameters
Type Name Description
int segments

The number of segments for approximating curves.

Returns
Type Description
IEnumerable<Polygon>

An enumerable of polygons approximating the path.

Remarks

This method approximates the path to a collection of polygons.

| Edit this page View Source

ApproximateToMultiPolygon(int)

Approximates the path to a collection of polygons.

Declaration
public MultiPolygon ApproximateToMultiPolygon(int segments)
Parameters
Type Name Description
int segments

The number of segments for approximating curves.

Returns
Type Description
MultiPolygon

An enumerable of polygons approximating the path.

| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Edit this page View Source

Dispose(bool)

Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing
| Edit this page View Source

Equals(Path?)

Compares two paths for equality.

Declaration
public bool Equals(Path? other)
Parameters
Type Name Description
Path other
Returns
Type Description
bool
Remarks

Paths equality must not change from serialization and deserialization. SKPath can apply some optimizations (e.g. remove redundant commands) when converting to string representation, so we want to avoid performing comparisons on the raw commands from the iterator. Comparisons are instead performed by comparing the precomputed string representations of the paths.

| Edit this page View Source

Equals(object?)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
| Edit this page View Source

FromXmlString(string)

Initializes a new instance of the Path class from an XML string.

Declaration
public static Path FromXmlString(string xmlString)
Parameters
Type Name Description
string xmlString

The XML string to initialize the instance with.

Returns
Type Description
Path
Remarks

This method initializes a new instance of the Path class from an XML string.

| Edit this page View Source

GetHashCode()

Serves as the default hash function.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()
| Edit this page View Source

ToSvgPath()

Declaration
public SvgPath ToSvgPath()
Returns
Type Description
SvgPath
| Edit this page View Source

ToXmlString()

Converts the path to an XML string.

Declaration
public string ToXmlString()
Returns
Type Description
string

The path as an XML string.

Remarks

This method converts the path to an XML string.

| Edit this page View Source

TryConvertToPoints(out PointList?)

Declaration
public bool TryConvertToPoints(out PointList? pointList)
Parameters
Type Name Description
PointList pointList
Returns
Type Description
bool

Operators

| Edit this page View Source

operator ==(Path?, Path?)

Implements the equality operator.

Declaration
public static bool operator ==(Path? left, Path? right)
Parameters
Type Name Description
Path left

The left path to compare.

Path right

The right path to compare.

Returns
Type Description
bool

True if the paths are equal, false otherwise.

| Edit this page View Source

operator !=(Path?, Path?)

Implements the inequality operator.

Declaration
public static bool operator !=(Path? left, Path? right)
Parameters
Type Name Description
Path left

The left path to compare.

Path right

The right path to compare.

Returns
Type Description
bool

True if the paths are not equal, false otherwise.

Implements

IEquatable<T>
IDisposable