StreamGeometryContext Class
Definition
Describes a geometry using drawing commands.
public class StreamGeometryContext
Remarks
This class is used to define the geometry of a Avalonia.Media.StreamGeometry. An instance of Avalonia.Media.StreamGeometryContext is obtained by calling Avalonia.Media.StreamGeometry.Open.
Constructors
| Name | Description |
|---|---|
| StreamGeometryContext | Initializes a new instance of the Avalonia.Media.StreamGeometryContext class. |
StreamGeometryContext Constructor
Initializes a new instance of the Avalonia.Media.StreamGeometryContext class.
public StreamGeometryContext(Avalonia.Platform.IStreamGeometryContextImpl impl)
Parameters
impl Avalonia.Platform.IStreamGeometryContextImpl
The platform-specific implementation.
Methods
| Name | Description |
|---|---|
| ArcTo | Draws an arc to the specified point. |
| BeginFigure | Begins a new figure. |
| CubicBezierTo | Draws a Bezier curve to the specified point. |
| Dispose | Finishes the drawing session. |
| EndFigure | Ends the figure started by Avalonia.Platform.IGeometryContext.BeginFigure(Avalonia.Point,bool). |
| LineTo | Draws a line to the specified point. |
| PreciseArcTo | 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. |
| QuadraticBezierTo | Draws a quadratic Bezier curve to the specified point |
| SetFillRule | 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. |
ArcTo Method
Draws an arc to the specified point.
public void ArcTo(Avalonia.Point point, Avalonia.Size size, double rotationAngle, bool isLargeArc, Avalonia.Media.SweepDirection sweepDirection, bool isStroked)
Parameters
point Avalonia.Point
The destination point.
size Avalonia.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 Avalonia.Media.SweepDirection
A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
isStroked bool
Whether the segment is stroked
BeginFigure Method
Begins a new figure.
public void BeginFigure(Avalonia.Point startPoint, bool isFilled)
Parameters
startPoint Avalonia.Point
The starting point for the figure.
isFilled bool
Whether the figure is filled.
CubicBezierTo Method
Draws a Bezier curve to the specified point.
public void CubicBezierTo(Avalonia.Point controlPoint1, Avalonia.Point controlPoint2, Avalonia.Point endPoint, bool isStroked)
Parameters
controlPoint1 Avalonia.Point
The first control point used to specify the shape of the curve.
controlPoint2 Avalonia.Point
The second control point used to specify the shape of the curve.
endPoint Avalonia.Point
The destination point for the end of the curve.
isStroked bool
Whether the segment is stroked
Dispose Method
Finishes the drawing session.
public void Dispose()
EndFigure Method
Ends the figure started by Avalonia.Platform.IGeometryContext.BeginFigure(Avalonia.Point,bool).
public void EndFigure(bool isClosed)
Parameters
isClosed bool
Whether the figure is closed.
LineTo Method
Draws a line to the specified point.
public void LineTo(Avalonia.Point point, bool isStroked)
Parameters
point Avalonia.Point
The destination point.
isStroked bool
Whether the segment is stroked
PreciseArcTo Method
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(Avalonia.Point point, Avalonia.Size size, double rotationAngle, bool isLargeArc, Avalonia.Media.SweepDirection sweepDirection)
Parameters
point Avalonia.Point
The destination point.
size Avalonia.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 Avalonia.Media.SweepDirection
A value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
QuadraticBezierTo Method
Draws a quadratic Bezier curve to the specified point
public void QuadraticBezierTo(Avalonia.Point controlPoint, Avalonia.Point endPoint, bool isStroked)
Parameters
controlPoint Avalonia.Point
The control point used to specify the shape of the curve.
endPoint Avalonia.Point
The destination point for the end of the curve.
isStroked bool
Whether the segment is stroked
SetFillRule Method
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(Avalonia.Media.FillRule fillRule)
Parameters
fillRule Avalonia.Media.FillRule