本文整理汇总了C#中GraphicsPath.Start方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.Start方法的具体用法?C# GraphicsPath.Start怎么用?C# GraphicsPath.Start使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath.Start方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawArc
/// <summary>
/// Draws an arc of an elipse.
/// </summary>
/// <param name="from">The start point of the arc.</param>
/// <param name="to">The end point of the arc.</param>
/// <param name="radius">The radius of the arc.</param>
/// <param name="angle">The angle of the arc, in radians.</param>
/// <param name="clockwise">If set to <see langword="true" /> the arc will be drawn clockwise.</param>
/// <param name="isLarge">Specifies whether the given arc is larger than 180 degrees</param>
public void DrawArc(Vector2 @from, Vector2 to, Vector2 radius, float angle, bool clockwise, bool isLarge)
{
using (GraphicsPath path = new GraphicsPath(DirectXResourceManager.CreatePathGeometry()))
{
path.Start(from)
.AddArc(to, radius, angle, clockwise, isLarge)
.End(false);
_renderTarget.DrawGeometry(path.PathGeometry, LineBrush, _lineWidth, _strokeStyle);
}
}
示例2: DrawCubicBezier
/// <summary>
/// Draws a cubic bezier curve to the end of the line.
/// </summary>
/// <param name="from">The start point of the curve.</param>
/// <param name="controlA">The first control point of the curve.</param>
/// <param name="controlB">The second control point of the curve.</param>
/// <param name="to">The end point of the curve.</param>
/// <returns>This <see cref="IGraphicsPath" />.</returns>
public void DrawCubicBezier(Vector2 @from, Vector2 controlA, Vector2 controlB, Vector2 to)
{
using (GraphicsPath path = new GraphicsPath(DirectXResourceManager.CreatePathGeometry()))
{
path.Start(from)
.AddCubicBezier(controlA, controlB, to)
.End(false);
_renderTarget.DrawGeometry(path.PathGeometry, LineBrush, _lineWidth, _strokeStyle);
}
}
示例3: DrawLines
/// <summary>
/// Draws a set of lines joining the array of points given.
/// </summary>
/// <param name="points">The points to draw lines between.</param>
public void DrawLines(Vector2[] points)
{
using (GraphicsPath path = new GraphicsPath(DirectXResourceManager.CreatePathGeometry()))
{
path.Start(points[0])
.AddLines(new ArraySegment<Vector2>(points, 1, points.Length - 1))
.End(false);
_renderTarget.DrawGeometry(path.PathGeometry, LineBrush, _lineWidth, _strokeStyle);
}
}