本文整理汇总了C#中System.Drawing.Graphics.DrawLines方法的典型用法代码示例。如果您正苦于以下问题:C# Graphics.DrawLines方法的具体用法?C# Graphics.DrawLines怎么用?C# Graphics.DrawLines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.Graphics
的用法示例。
在下文中一共展示了Graphics.DrawLines方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawLinesPointF
public void DrawLinesPointF(PaintEventArgs e)
{
// Create pen.
Pen pen = new Pen(Color.Black, 3);
// Create array of points that define lines to draw.
PointF[] points =
{
new PointF(10.0F, 10.0F),
new PointF(10.0F, 100.0F),
new PointF(200.0F, 50.0F),
new PointF(250.0F, 300.0F)
};
//Draw lines to screen.
e.Graphics.DrawLines(pen, points);
}
示例2: DrawLinesPoint
public void DrawLinesPoint(PaintEventArgs e)
{
// Create pen.
Pen pen = new Pen(Color.Black, 3);
// Create array of points that define lines to draw.
Point[] points =
{
new Point(10, 10),
new Point(10, 100),
new Point(200, 50),
new Point(250, 300)
};
//Draw lines to screen.
e.Graphics.DrawLines(pen, points);
}
示例3: Graphics.DrawLines(Pen pen, Point[] points)
//引入命名空间
using System;
using System.Drawing;
using System.Windows.Forms;
class WidePolyline: Form
{
public static void Main()
{
Application.Run(new WidePolyline());
}
public WidePolyline()
{
ResizeRedraw = true;
}
protected override void OnPaint(PaintEventArgs pea)
{
DoPage(pea.Graphics, ForeColor,ClientSize.Width, ClientSize.Height);
}
protected void DoPage(Graphics grfx, Color clr, int cx, int cy)
{
Pen pen = new Pen(clr, 25);
grfx.DrawLines(pen, new Point[] {
new Point( 25, 100), new Point(125, 100),
new Point(125, 50), new Point(225, 50),
new Point(225, 100), new Point(325, 100) });
}
}