Advertisement
Guest User

gergaji line

a guest
Jun 15th, 2019
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim myGraphics As Graphics = PictureBox1.CreateGraphics
  2.         Dim x1, y1, x2, y2,x3,x4,x5 As Integer
  3.  
  4.         Dim myPen0 As New Pen(Color.Blue, 2)
  5.         Dim myPen1 As New Pen(Color.Red, 5)
  6.         Dim myPen2 As New Pen(Color.Brown, 2)
  7.         myGraphics.TranslateTransform(50, 250)
  8.         For id = 0 To 9
  9.             x1 = id * 50
  10.             x2 = x1
  11.             x3 = x2 + 25
  12.             x4 = x3
  13.             x5 = x4 + 25
  14.  
  15.  
  16.  
  17.             myGraphics.DrawLine(myPen0, x1, 0, x2, 50 * (-1))
  18.             myGraphics.DrawLine(myPen0, x2, 50 * (-1), x3, 50 * (-1))
  19.             myGraphics.DrawLine(myPen0, x3, 50 * (-1), x4, 0)
  20.             myGraphics.DrawLine(myPen0, x4, 0, x5, 0)
  21.             TextBox1.Text = TextBox1.Text + x1.ToString() + "," + y1.ToString() + "-->" + x2.ToString() + "," + y2.ToString() + vbCrLf
  22.  
  23.         Next
  24.  
  25.  
  26.  
  27.  
  28.  
  29.     End Sub
  30.  
  31.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  32.         Me.AutoSize = True
  33.         PictureBox1.Top = 0 : PictureBox1.Left = 0
  34.         PictureBox1.Width = 500 : PictureBox1.Height = 500
  35.         Button1.Left = PictureBox1.Width + 50 : Button1.Top = 150
  36.  
  37.  
  38.     End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement