GraphicsPath.AddLines メソッド (PointF[])
アセンブリ: System.Drawing (system.drawing.dll 内)


図形の中に前回描画された直線や曲線がある場合、前の線分の終了点と直線の開始点を結ぶ直線が追加されます。points パラメータでは、終了点の配列が指定されます。最初の 2 つによって最初の直線が指定されます。それ以降の各点によって、前の直線の終了点を開始点とする線分の終了点が指定されます。


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GraphicsPath.AddLines メソッド (Point[])
アセンブリ: System.Drawing (system.drawing.dll 内)


図形の中に前回描画された直線や曲線がある場合、前の線分の終了点と直線の開始点を結ぶ直線が追加されます。points パラメータでは、終了点の配列が指定されます。最初の 2 つによって最初の直線が指定されます。それ以降の各点によって、前の直線の終了点を開始点とする線分の終了点が指定されます。

次のコード例は、Windows フォームでの使用を意図してデザインされており、OnPaint イベント オブジェクトである PaintEventArgse が必要です。このコードは次のアクションを実行します。
最初の点以降の各直線は前の点を開始点として使用し、新しい点を終了点として使用します。
Public Sub AddLinesExample(ByVal e As PaintEventArgs) 'Create a symetrical triangle using an array of points. Dim myArray As Point() = {New Point(30, 30), New Point(60, 60), _ New Point(0, 60), New Point(30, 30)} Dim myPath As New GraphicsPath myPath.AddLines(myArray) ' Draw the path to the screen. Dim myPen As New Pen(Color.Black, 2) e.Graphics.DrawPath(myPen, myPath) End Sub
private void AddLinesExample(PaintEventArgs e) { // Create a symetrical triangle using an array of points. Point[] myArray = { new Point(30,30), new Point(60,60), new Point(0,60), new Point(30,30) }; //Create a path and add lines. GraphicsPath myPath = new GraphicsPath(); myPath.AddLines(myArray); // Draw the path to the screen. Pen myPen = new Pen(Color.Black, 2); e.Graphics.DrawPath(myPen, myPath); }
private: void AddLinesExample( PaintEventArgs^ e ) { // Create a symetrical triangle using an array of points. array<Point>^ myArray = {Point(30,30),Point(60,60),Point(0,60),Point(30 ,30)}; //Create a path and add lines. GraphicsPath^ myPath = gcnew GraphicsPath; myPath->AddLines( myArray ); // Draw the path to the screen. Pen^ myPen = gcnew Pen( Color::Black,2.0f ); e->Graphics->DrawPath( myPen, myPath ); }
private void AddLinesExample(PaintEventArgs e) { // Create a symetrical triangle using an array of points. Point myArray[] = { new Point(30, 30), new Point(60, 60), new Point(0, 60), new Point(30, 30) }; //Create a path and add lines. GraphicsPath myPath = new GraphicsPath(); myPath.AddLines(myArray); // Draw the path to the screen. Pen myPen = new Pen(Color.get_Black(), 2); e.get_Graphics().DrawPath(myPen, myPath); } //AddLinesExample

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


GraphicsPath.AddLines メソッド
- GraphicsPath.AddLines メソッドのページへのリンク