Graphics.DrawLine(Pen p, Int x, Int y, Int x1, Int y1) : Graphics « System.Drawing « VB.Net by API






Graphics.DrawLine(Pen p, Int x, Int y, Int x1, Int y1)

  

Imports System
Imports System.Windows.Forms
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Drawing.Imaging
Imports System.Drawing

Public Class MainClass

   Shared Sub Main()
        Dim bm As New Bitmap(256, 256)

        ' Draw on it.
        Dim gr As Graphics = Graphics.FromImage(bm)
        gr.Clear(Color.White)
        gr.DrawEllipse(Pens.Red, 0, 0, bm.Width - 1, bm.Height - 1)
        gr.DrawLine(Pens.Green, 0, 0, bm.Width - 1, bm.Height - 1)
        gr.DrawLine(Pens.Blue, bm.Width - 1, 0, 0, bm.Height - 1)

        ' Save the result as a JPEG file.
        bm.Save("test.gif", ImageFormat.Gif)
   End Sub 

End Class

   
    
  








Related examples in the same category

1.Graphics.DrawString
2.Graphics.MeasureString
3.Graphics.Clear(Color c)
4.Graphics.Clip
5.Graphics.CompositingMode
6.Graphics.CompositingQuality
7.Graphics.DrawArc
8.Graphics.DrawBezier
9.Graphics.DrawClosedCurve
10.Graphics.DrawCurve
11.Graphics.DrawEllipse(Pen, Int x, Int y, Int w, Int h)
12.Graphics.DrawIcon
13.Graphics.DrawImage(Bitmap bmp, Int x, Int y)
14.Graphics.DrawPath
15.Graphics.DrawPolygon
16.Graphics.DrawRectangle(Pen pen1, Rectangle rectangle1)
17.Graphics.DrawString(String s, Font m, Brush , Int x, Int y)
18.Graphics.ExcludeClip
19.Graphics.FillClosedCurve
20.Graphics.FillEllipse
21.Graphics.FillPath
22.Graphics.FillPie
23.Graphics.FillPolygon
24.Graphics.FillRectangle(Brush b, Rectangle rect)
25.Graphics.FromImage(Bitmap m)
26.Graphics.MeasureCharacterRanges
27.Graphics.PageUnit
28.Graphics.ResetTransform()
29.Graphics.Restore
30.Graphics.ScaleTransform
31.Graphics.SetClip(Shape shape,CombineMode)
32.Graphics.SmoothingMode
33.Graphics.TextRenderingHint
34.Graphics.Transform
35.Graphics.TranslateTransform