Class StreamGeometryContext
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
IStreamGeometryContextImplThe 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
PointThe destination point.
size
SizeThe radii of an oval whose perimeter is used to draw the angle.
rotationAngle
doubleThe rotation angle (in radians) of the oval that specifies the curve.
isLargeArc
booltrue to draw the arc greater than 180 degrees; otherwise, false.
sweepDirection
SweepDirectionA 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
PointThe destination point.
size
SizeThe radii of an oval whose perimeter is used to draw the angle.
rotationAngle
doubleThe rotation angle (in radians) of the oval that specifies the curve.
isLargeArc
booltrue to draw the arc greater than 180 degrees; otherwise, false.
sweepDirection
SweepDirectionA value that indicates whether the arc is drawn in the Clockwise or Counterclockwise direction.
isStroked
boolWhether the segment is stroked
BeginFigure(Point, bool)
Begins a new figure.
public void BeginFigure(Point startPoint, bool isFilled)
Parameters
CubicBezierTo(Point, Point, Point)
Draws a Bezier curve to the specified point.
public void CubicBezierTo(Point controlPoint1, Point controlPoint2, Point endPoint)
Parameters
controlPoint1
PointThe first control point used to specify the shape of the curve.
controlPoint2
PointThe second control point used to specify the shape of the curve.
endPoint
PointThe 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
PointThe first control point used to specify the shape of the curve.
controlPoint2
PointThe second control point used to specify the shape of the curve.
endPoint
PointThe destination point for the end of the curve.
isStroked
boolWhether 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
boolWhether the figure is closed.
LineTo(Point)
Draws a line to the specified point.
public void LineTo(Point endPoint)
Parameters
endPoint
PointThe destination point.
LineTo(Point, bool)
Draws a line to the specified point.
public void LineTo(Point point, bool isStroked)
Parameters
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
PointThe destination point.
size
SizeThe radii of an oval whose perimeter is used to draw the angle.
rotationAngle
doubleThe rotation angle (in radians) of the oval that specifies the curve.
isLargeArc
booltrue to draw the arc greater than 180 degrees; otherwise, false.
sweepDirection
SweepDirectionA 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
QuadraticBezierTo(Point, Point, bool)
Draws a quadratic Bezier curve to the specified point
public void QuadraticBezierTo(Point controlPoint, Point endPoint, bool isStroked)
Parameters
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