Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim myGraphics As Graphics = PictureBox1.CreateGraphics
- Dim x1, y1, x2, y2,x3,x4,x5 As Integer
- Dim myPen0 As New Pen(Color.Blue, 2)
- Dim myPen1 As New Pen(Color.Red, 5)
- Dim myPen2 As New Pen(Color.Brown, 2)
- myGraphics.TranslateTransform(50, 250)
- For id = 0 To 9
- x1 = id * 50
- x2 = x1
- x3 = x2 + 25
- x4 = x3
- x5 = x4 + 25
- myGraphics.DrawLine(myPen0, x1, 0, x2, 50 * (-1))
- myGraphics.DrawLine(myPen0, x2, 50 * (-1), x3, 50 * (-1))
- myGraphics.DrawLine(myPen0, x3, 50 * (-1), x4, 0)
- myGraphics.DrawLine(myPen0, x4, 0, x5, 0)
- TextBox1.Text = TextBox1.Text + x1.ToString() + "," + y1.ToString() + "-->" + x2.ToString() + "," + y2.ToString() + vbCrLf
- Next
- End Sub
- Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
- Me.AutoSize = True
- PictureBox1.Top = 0 : PictureBox1.Left = 0
- PictureBox1.Width = 500 : PictureBox1.Height = 500
- Button1.Left = PictureBox1.Width + 50 : Button1.Top = 150
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement