Graphics.DrawLine メソッド (Pen, PointF, PointF)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Graphics Dim pen As Pen Dim pt1 As PointF Dim pt2 As PointF instance.DrawLine(pen, pt1, pt2)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub DrawLinePointF(ByVal e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create points that define line. Dim point1 As New PointF(100.0F, 100.0F) Dim point2 As New PointF(500.0F, 100.0F) ' Draw line to screen. e.Graphics.DrawLine(blackPen, point1, point2) End Sub
public void DrawLinePointF(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create points that define line. PointF point1 = new PointF(100.0F, 100.0F); PointF point2 = new PointF(500.0F, 100.0F); // Draw line to screen. e.Graphics.DrawLine(blackPen, point1, point2); }
public: void DrawLinePointF( PaintEventArgs^ e ) { // Create pen. Pen^ blackPen = gcnew Pen( Color::Black,3.0f ); // Create points that define line. PointF point1 = PointF(100.0F,100.0F); PointF point2 = PointF(500.0F,100.0F); // Draw line to screen. e->Graphics->DrawLine( blackPen, point1, point2 ); }
public void DrawLinePointF(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.get_Black(), 3); // Create points that define line. PointF point1 = new PointF(100, 100); PointF point2 = new PointF(500, 100); // Draw line to screen. e.get_Graphics().DrawLine(blackPen, point1, point2); } //DrawLinePointF

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawLine メソッド (Pen, Point, Point)
アセンブリ: System.Drawing (system.drawing.dll 内)

Dim instance As Graphics Dim pen As Pen Dim pt1 As Point Dim pt2 As Point instance.DrawLine(pen, pt1, pt2)


次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub DrawLinePoint(ByVal e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create points that define line. Dim point1 As New Point(100, 100) Dim point2 As New Point(500, 100) ' Draw line to screen. e.Graphics.DrawLine(blackPen, point1, point2) End Sub
public void DrawLinePoint(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create points that define line. Point point1 = new Point(100, 100); Point point2 = new Point(500, 100); // Draw line to screen. e.Graphics.DrawLine(blackPen, point1, point2); }
public: void DrawLinePoint( PaintEventArgs^ e ) { // Create pen. Pen^ blackPen = gcnew Pen( Color::Black,3.0f ); // Create points that define line. Point point1 = Point(100,100); Point point2 = Point(500,100); // Draw line to screen. e->Graphics->DrawLine( blackPen, point1, point2 ); }
public void DrawLinePoint(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.get_Black(), 3); // Create points that define line. Point point1 = new Point(100, 100); Point point2 = new Point(500, 100); // Draw line to screen. e.get_Graphics().DrawLine(blackPen, point1, point2); } //DrawLinePoint

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawLine メソッド

名前 | 説明 |
---|---|
Graphics.DrawLine (Pen, Point, Point) | 2 つの Point 構造体を接続する直線を描画します。 |
Graphics.DrawLine (Pen, PointF, PointF) | 2 つの PointF 構造体を接続する直線を描画します。 |
Graphics.DrawLine (Pen, Int32, Int32, Int32, Int32) | 座標ペアで指定された 2 つの点を結ぶ直線を描画します。 .NET Compact Framework によってサポートされています。 |
Graphics.DrawLine (Pen, Single, Single, Single, Single) | 座標ペアで指定された 2 つの点を結ぶ直線を描画します。 |

Graphics.DrawLine メソッド (Pen, Single, Single, Single, Single)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub DrawLine ( _ pen As Pen, _ x1 As Single, _ y1 As Single, _ x2 As Single, _ y2 As Single _ )
Dim instance As Graphics Dim pen As Pen Dim x1 As Single Dim y1 As Single Dim x2 As Single Dim y2 As Single instance.DrawLine(pen, x1, y1, x2, y2)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub DrawLineFloat(ByVal e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create coordinates of points that define line. Dim x1 As Single = 100.0F Dim y1 As Single = 100.0F Dim x2 As Single = 500.0F Dim y2 As Single = 100.0F ' Draw line to screen. e.Graphics.DrawLine(blackPen, x1, y1, x2, y2) End Sub
public void DrawLineFloat(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create coordinates of points that define line. float x1 = 100.0F; float y1 = 100.0F; float x2 = 500.0F; float y2 = 100.0F; // Draw line to screen. e.Graphics.DrawLine(blackPen, x1, y1, x2, y2); }
public: void DrawLineFloat( PaintEventArgs^ e ) { // Create pen. Pen^ blackPen = gcnew Pen( Color::Black,3.0f ); // Create coordinates of points that define line. float x1 = 100.0F; float y1 = 100.0F; float x2 = 500.0F; float y2 = 100.0F; // Draw line to screen. e->Graphics->DrawLine( blackPen, x1, y1, x2, y2 ); }
public void DrawLineFloat(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.get_Black(), 3); // Create coordinates of points that define line. float x1 = 100; float y1 = 100; float x2 = 500; float y2 = 100; // Draw line to screen. e.get_Graphics().DrawLine(blackPen, x1, y1, x2, y2); } //DrawLineFloat

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Graphics.DrawLine メソッド (Pen, Int32, Int32, Int32, Int32)
アセンブリ: System.Drawing (system.drawing.dll 内)

Public Sub DrawLine ( _ pen As Pen, _ x1 As Integer, _ y1 As Integer, _ x2 As Integer, _ y2 As Integer _ )
Dim instance As Graphics Dim pen As Pen Dim x1 As Integer Dim y1 As Integer Dim x2 As Integer Dim y2 As Integer instance.DrawLine(pen, x1, y1, x2, y2)



次の例は、Windows フォームでの使用を意図してデザインされており、Paint イベント ハンドラのパラメータである PaintEventArgse が必要です。このコードは次のアクションを実行します。
Public Sub DrawLineInt(ByVal e As PaintEventArgs) ' Create pen. Dim blackPen As New Pen(Color.Black, 3) ' Create coordinates of points that define line. Dim x1 As Integer = 100 Dim y1 As Integer = 100 Dim x2 As Integer = 500 Dim y2 As Integer = 100 ' Draw line to screen. e.Graphics.DrawLine(blackPen, x1, y1, x2, y2) End Sub
public void DrawLineInt(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.Black, 3); // Create coordinates of points that define line. int x1 = 100; int y1 = 100; int x2 = 500; int y2 = 100; // Draw line to screen. e.Graphics.DrawLine(blackPen, x1, y1, x2, y2); }
public: void DrawLineInt( PaintEventArgs^ e ) { // Create pen. Pen^ blackPen = gcnew Pen( Color::Black,3.0f ); // Create coordinates of points that define line. int x1 = 100; int y1 = 100; int x2 = 500; int y2 = 100; // Draw line to screen. e->Graphics->DrawLine( blackPen, x1, y1, x2, y2 ); }
public void DrawLineInt(PaintEventArgs e) { // Create pen. Pen blackPen = new Pen(Color.get_Black(), 3); // Create coordinates of points that define line. int x1 = 100; int y1 = 100; int x2 = 500; int y2 = 100; // Draw line to screen. e.get_Graphics().DrawLine(blackPen, x1, y1, x2, y2); } //DrawLineInt

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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からGraphics.DrawLineを検索する場合は、下記のリンクをクリックしてください。

- Graphics.DrawLineのページへのリンク