本文整理汇总了C#中System.Drawing.Drawing2D.GraphicsPath.StartFigure方法的典型用法代码示例。如果您正苦于以下问题:C# GraphicsPath.StartFigure方法的具体用法?C# GraphicsPath.StartFigure怎么用?C# GraphicsPath.StartFigure使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Drawing2D.GraphicsPath
的用法示例。
在下文中一共展示了GraphicsPath.StartFigure方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartFigureExample
public void StartFigureExample(PaintEventArgs e)
{
// Create a GraphicsPath object.
GraphicsPath myPath = new GraphicsPath();
// First set of figures.
myPath.StartFigure();
myPath.AddArc(10, 10, 50, 50, 0, 270);
myPath.AddLine(new Point(50, 0), new Point(100, 50));
myPath.AddArc(50, 100, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 10, 50, 50, 0, 270);
// Second set of figures.
myPath.StartFigure();
myPath.AddArc(10, 200, 50, 50, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddLine(new Point(60, 200), new Point(110, 250));
myPath.AddArc(50, 300, 75, 75, 0, 270);
myPath.CloseFigure();
myPath.StartFigure();
myPath.AddArc(100, 200, 50, 50, 0, 270);
// Draw the path to the screen.
e.Graphics.DrawPath(new Pen(Color.Black), myPath);
}
// End StartFigureExample
示例2: GraphicsPath.StartFigure()
//引入命名空间
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Text;
using System.Windows.Forms;
public class Form1 : Form {
protected override void OnPaint(PaintEventArgs e) {
Graphics g = e.Graphics;
g.FillRectangle(Brushes.White, this.ClientRectangle);
GraphicsPath gp = new GraphicsPath();
gp.AddLine(10, 10, 10, 50);
gp.AddBezier(10, 50, 10, 55, 25, 70, 30, 70);
gp.StartFigure();
gp.AddLine(60, 110, 40, 160);
g.DrawPath(Pens.Black, gp);
gp.Dispose();
}
public static void Main() {
Application.Run(new Form1());
}
}