Table of Contents

Class StreamGeometryContext

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Describes a geometry using drawing commands.

public class StreamGeometryContext : IGeometryContext2, IGeometryContext, IDisposable
Inheritance
StreamGeometryContext
Implements
Inherited Members

Remarks

This class is used to define the geometry of a StreamGeometry. An instance of StreamGeometryContext is obtained by calling Open().

Constructors

StreamGeometryContext(IStreamGeometryContextImpl)

Initializes a new instance of the StreamGeometryContext class.

public StreamGeometryContext(IStreamGeometryContextImpl impl)

Parameters

impl IStreamGeometryContextImpl

The platform-specific implementation.

Methods

ArcTo(Point, Size, double, bool, SweepDirection)

Draws an arc to the specified point.

public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)

Parameters

point Point

The destination point.

size Size

The radii of an oval whose perimeter is used to draw the angle.

rotationAngle double

The rotation angle (in radians) of the oval that specifies the curve.

isLargeArc bool

true to draw the arc greater than 180 degrees; otherwise, false.

sweepDirection SweepDirection

A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.

ArcTo(Point, Size, double, bool, SweepDirection, bool)

Draws an arc to the specified point.

public void ArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection, bool isStroked)

Parameters

point Point

The destination point.

size Size

The radii of an oval whose perimeter is used to draw the angle.

rotationAngle double

The rotation angle (in radians) of the oval that specifies the curve.

isLargeArc bool

true to draw the arc greater than 180 degrees; otherwise, false.

sweepDirection SweepDirection

A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.

isStroked bool

Whether the segment is stroked

BeginFigure(Point, bool)

Begins a new figure.

public void BeginFigure(Point startPoint, bool isFilled)

Parameters

startPoint Point

The starting point for the figure.

isFilled bool

Whether the figure is filled.

CubicBezierTo(Point, Point, Point)

Draws a Bezier curve to the specified point.

public void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint)

Parameters

controlPoint1 Point

The first control point used to specify the shape of the curve.

controlPoint2 Point

The second control point used to specify the shape of the curve.

endPoint Point

The destination point for the end of the curve.

CubicBezierTo(Point, Point, Point, bool)

Draws a Bezier curve to the specified point.

public void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint, bool isStroked)

Parameters

controlPoint1 Point

The first control point used to specify the shape of the curve.

controlPoint2 Point

The second control point used to specify the shape of the curve.

endPoint Point

The destination point for the end of the curve.

isStroked bool

Whether the segment is stroked

Dispose()

Finishes the drawing session.

public void Dispose()

EndFigure(bool)

Ends the figure started by BeginFigure(Point, bool).

public void EndFigure(bool isClosed)

Parameters

isClosed bool

Whether the figure is closed.

LineTo(Point)

Draws a line to the specified point.

public void LineTo(Point endPoint)

Parameters

endPoint Point

The destination point.

LineTo(Point, bool)

Draws a line to the specified point.

public void LineTo(Point point, bool isStroked)

Parameters

point Point

The destination point.

isStroked bool

Whether the segment is stroked

PreciseArcTo(Point, Size, double, bool, SweepDirection)

Draws an arc to the specified point using polylines, quadratic or cubic Bezier curves Significantly more precise when drawing elliptic arcs with extreme width:height ratios.

public void PreciseArcTo(Point point, Size size, double rotationAngle, bool isLargeArc, SweepDirection sweepDirection)

Parameters

point Point

The destination point.

size Size

The radii of an oval whose perimeter is used to draw the angle.

rotationAngle double

The rotation angle (in radians) of the oval that specifies the curve.

isLargeArc bool

true to draw the arc greater than 180 degrees; otherwise, false.

sweepDirection SweepDirection

A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.

QuadraticBezierTo(Point, Point)

Draws a quadratic Bezier curve to the specified point

public void QuadraticBezierTo(Point controlPoint, Point endPoint)

Parameters

controlPoint Point
endPoint Point

DestinationPoint

QuadraticBezierTo(Point, Point, bool)

Draws a quadratic Bezier curve to the specified point

public void QuadraticBezierTo(Point controlPoint, Point endPoint, bool isStroked)

Parameters

controlPoint Point
endPoint Point

DestinationPoint

isStroked bool

Whether the segment is stroked

SetFillRule(FillRule)

Sets path's winding rule (default is EvenOdd). You should call this method before any calls to BeginFigure. If you wonder why, ask Direct2D guys about their design decisions.

public void SetFillRule(FillRule fillRule)

Parameters

fillRule FillRule