本文整理汇总了C#中System.Drawing.Drawing2D.GraphicsPath.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.Reset方法的具体用法?C# GraphicsPath.Reset怎么用?C# GraphicsPath.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Drawing2D.GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath.Reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GraphicsPathResetExample
public void GraphicsPathResetExample(PaintEventArgs e)
{
Font myFont = new Font("Arial", 8);
// Create a path and add a line, an ellipse, and an arc.
GraphicsPath myPath = new GraphicsPath();
myPath.AddLine(new Point(0, 0), new Point(100, 100));
myPath.AddEllipse(100, 100, 200, 250);
myPath.AddArc(300, 250, 100, 100, 0, 90);
// Draw the pre-reset points array to the screen.
DrawPoints1(e, myPath.PathPoints, 20);
// Reset the path.
myPath.Reset();
// See if any points remain.
if(myPath.PointCount > 0)
{
// Draw the post-reset points array to the screen.
DrawPoints1(e, myPath.PathPoints, 150);
}
else
// If there are no points, say so.
e.Graphics.DrawString("No Points",
myFont,
Brushes.Black,
150,
20);
}
//End GraphicsPathResetExample
// A helper function GraphicsPathResetExample uses to draw the points.
// to the screen.
public void DrawPoints1(PaintEventArgs e, PointF[] pathPoints, int xOffset)
{
int y = 20;
Font myFont = new Font("Arial", 8);
for(int i=0;i < pathPoints.Length; i++)
{
e.Graphics.DrawString(pathPoints[i].X.ToString() + ", " +
pathPoints[i].Y.ToString(),
myFont,
Brushes.Black,
xOffset,
y);
y += 20;
}
}
// End DrawPoints