本文整理匯總了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) });
}
}