Table of Contents

Interface IGeometryImpl

Namespace
Avalonia.Platform
Assembly
Avalonia.Base.dll

Defines the platform-specific interface for a Geometry.

[Unstable]
public interface IGeometryImpl

Properties

Bounds

Gets the geometry's bounding rectangle.

Rect Bounds { get; }

Property Value

Rect

ContourLength

Gets the geometry's total length as if all its contours are placed in a straight line.

double ContourLength { get; }

Property Value

double

Methods

FillContains(Point)

Indicates whether the geometry's fill contains the specified point.

bool FillContains(Point point)

Parameters

point Point

The point.

Returns

bool

true if the geometry contains the point; otherwise, false.

GetRenderBounds(IPen?)

Gets the geometry's bounding rectangle with the specified pen.

Rect GetRenderBounds(IPen? pen)

Parameters

pen IPen

The pen to use. May be null.

Returns

Rect

The bounding rectangle.

GetWidenedGeometry(IPen)

Gets a geometry that is the shape defined by the stroke on the geometry produced by the specified Pen.

IGeometryImpl GetWidenedGeometry(IPen pen)

Parameters

pen IPen

The pen to use.

Returns

IGeometryImpl

The outlined geometry.

Intersect(IGeometryImpl)

Intersects the geometry with another geometry.

IGeometryImpl? Intersect(IGeometryImpl geometry)

Parameters

geometry IGeometryImpl

The other geometry.

Returns

IGeometryImpl

A new IGeometryImpl representing the intersection or null when the operation failed.

StrokeContains(IPen?, Point)

Indicates whether the geometry's stroke contains the specified point.

bool StrokeContains(IPen? pen, Point point)

Parameters

pen IPen

The stroke to use.

point Point

The point.

Returns

bool

true if the geometry contains the point; otherwise, false.

TryGetPointAndTangentAtDistance(double, out Point, out Point)

Attempts to get the corresponding point and tangent from the specified distance along the contour of the geometry.

bool TryGetPointAndTangentAtDistance(double distance, out Point point, out Point tangent)

Parameters

distance double

The contour distance to get from.

point Point

The point in the specified distance.

tangent Point

The tangent in the specified distance.

Returns

bool

If there's valid point and tangent at the specified distance.

TryGetPointAtDistance(double, out Point)

Attempts to get the corresponding point at the specified distance

bool TryGetPointAtDistance(double distance, out Point point)

Parameters

distance double

The contour distance to get from.

point Point

The point in the specified distance.

Returns

bool

If there's valid point at the specified distance.

TryGetSegment(double, double, bool, out IGeometryImpl?)

Attempts to get the corresponding path segment given by the two distances specified. Imagine it like snipping a part of the current geometry.

bool TryGetSegment(double startDistance, double stopDistance, bool startOnBeginFigure, out IGeometryImpl? segmentGeometry)

Parameters

startDistance double

The contour distance to start snipping from.

stopDistance double

The contour distance to stop snipping to.

startOnBeginFigure bool

If ture, the resulting snipped path will start with a BeginFigure call.

segmentGeometry IGeometryImpl

The resulting snipped path.

Returns

bool

If the snipping operation is successful.

WithTransform(Matrix)

Makes a clone of the geometry with the specified transform.

ITransformedGeometryImpl WithTransform(Matrix transform)

Parameters

transform Matrix

The transform.

Returns

ITransformedGeometryImpl

The cloned geometry.