Graphics.DrawLines メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Graphics.DrawLines メソッドの意味・解説 

Graphics.DrawLines メソッド (Pen, Point[])

Point 構造体配列接続する一連の線分描画ます。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawLines ( _
    pen As Pen, _
    points As Point() _
)
public void DrawLines (
    Pen pen,
    Point[] points
)
public:
void DrawLines (
    Pen^ pen, 
    array<Point>^ points
)
public void DrawLines (
    Pen pen, 
    Point[] points
)
public function DrawLines (
    pen : Pen, 
    points : Point[]
)

パラメータ

pen

線分の色、幅、およびスタイル決定する Pen

points

接続する複数の点を表す Point 構造体配列

例外例外
例外種類条件

ArgumentNullException

pennull 参照 (Visual Basic では Nothing) です。

または

pointsnull 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

Public Sub DrawLinesPoint(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create array of points that define lines to draw.
    Dim points As Point() = {New Point(10,
 10), New Point(10, 100), _
    New Point(200, 50), New Point(250, 300)}

    'Draw lines to screen.
    e.Graphics.DrawLines(blackPen, points)
End Sub
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);
}
public:
   void DrawLinesPoint( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ pen = gcnew Pen( Color::Black,3.0f );

      // Create array of points that define lines to draw.
      array<Point>^ points = {Point(10,10),Point(10,100),Point(200,50),Point(250
,300)};

      //Draw lines to screen.
      e->Graphics->DrawLines( pen, points );
   }
public void DrawLinesPoint(PaintEventArgs e)
 
{
    // Create pen.
    Pen pen =  new Pen(Color.get_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.get_Graphics().DrawLines(pen, points);
} //DrawLinesPoint
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawLines メソッド (Pen, PointF[])

PointF 構造体配列接続する一連の線分描画ます。

名前空間: System.Drawing
アセンブリ: System.Drawing (system.drawing.dll 内)
構文構文

Public Sub DrawLines ( _
    pen As Pen, _
    points As PointF() _
)
Dim instance As Graphics
Dim pen As Pen
Dim points As PointF()

instance.DrawLines(pen, points)
public void DrawLines (
    Pen pen,
    PointF[] points
)
public:
void DrawLines (
    Pen^ pen, 
    array<PointF>^ points
)
public void DrawLines (
    Pen pen, 
    PointF[] points
)
public function DrawLines (
    pen : Pen, 
    points : PointF[]
)

パラメータ

pen

線分の色、幅、およびスタイル決定する Pen

points

接続する複数の点を表す PointF 構造体配列

例外例外
例外種類条件

ArgumentNullException

pennull 参照 (Visual Basic では Nothing) です。

または

pointsnull 参照 (Visual Basic では Nothing) です。

解説解説
使用例使用例

次の例は、Windows フォームでの使用意図してデザインされており、Paint イベント ハンドラパラメータである PaintEventArgse が必要です。このコード次のアクション実行します

Public Sub DrawLinesPointF(ByVal
 e As PaintEventArgs)

    ' Create pen.
    Dim blackPen As New
 Pen(Color.Black, 3)

    ' Create array of points that define lines to draw.
    Dim points As PointF() = {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(blackPen, points)
End Sub
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);
}
public:
   void DrawLinesPointF( PaintEventArgs^ e )
   {
      // Create pen.
      Pen^ pen = gcnew Pen( Color::Black,3.0f );

      // Create array of points that define lines to draw.
      array<PointF>^ points = {PointF(10.0F,10.0F),PointF(10.0F,100.0F),PointF(200.0F
,50.0F),PointF(250.0F,300.0F)};

      //Draw lines to screen.
      e->Graphics->DrawLines( pen, points );
   }
public void DrawLinesPointF(PaintEventArgs
 e) 
{
    // Create pen.
    Pen pen =  new Pen(Color.get_Black(), 3);

    // Create array of points that define lines to draw.
    PointF points[] =  {new PointF(10, 10), new
 PointF(10, 100), 
                        new PointF(200, 50), new
 PointF(250, 300)};

    //Draw lines to screen.
    e.get_Graphics().DrawLines(pen, points);
} //DrawLinesPointF
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

Graphics.DrawLines メソッド



このページでは「.NET Framework クラス ライブラリ リファレンス」からGraphics.DrawLines メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からGraphics.DrawLines メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からGraphics.DrawLines メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Graphics.DrawLines メソッド」の関連用語

Graphics.DrawLines メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Graphics.DrawLines メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS