Interface IGeometryImpl
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
ContourLength
Gets the geometry's total length as if all its contours are placed in a straight line.
double ContourLength { get; }
Property Value
Methods
FillContains(Point)
Indicates whether the geometry's fill contains the specified point.
bool FillContains(Point point)
Parameters
point
PointThe 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
IPenThe 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
IPenThe pen to use.
Returns
- IGeometryImpl
The outlined geometry.
Intersect(IGeometryImpl)
Intersects the geometry with another geometry.
IGeometryImpl? Intersect(IGeometryImpl geometry)
Parameters
geometry
IGeometryImplThe 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
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
doubleThe contour distance to get from.
point
PointThe point in the specified distance.
tangent
PointThe 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
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
doubleThe contour distance to start snipping from.
stopDistance
doubleThe contour distance to stop snipping to.
startOnBeginFigure
boolIf ture, the resulting snipped path will start with a BeginFigure call.
segmentGeometry
IGeometryImplThe 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
MatrixThe transform.
Returns
- ITransformedGeometryImpl
The cloned geometry.