Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. Sub DrawScreen()
  2. 'Call g.DrawImage to draw whatever you want in here
  3. Dim layers(Me.ListBox1.Items.Count) As PictureBox
  4.  
  5. For i = 0 To ListBox1.Items.Count - 1
  6. 'Create New Layer as picturebox
  7. layers(i) = New PictureBox
  8. layers(i).Parent = Me.picWatch
  9. layers(i).BackColor = Color.Transparent
  10. layers(i).Visible = True
  11.  
  12. Select Case ListBox1.Items(i)
  13.  
  14. Case "image"
  15. 'Debug.Print(ListofLayers(i).Full_Path)
  16. layers(i).Image = Image.FromFile(ListofLayers(i).Full_Path)
  17. layers(i).Top = ListofLayers(i).X
  18. picWatch.Controls.Add(layers(i))
  19.  
  20. Case "shape"
  21. 'Dim g As Graphics
  22. 'g.DrawRectangle()
  23.  
  24. Case "text"
  25. Dim g As Graphics = layers(i).CreateGraphics
  26. g.DrawString(ListofLayers(i).Text, New Font("Arial", 12), Brushes.White, ListofLayers(i).X, ListofLayers(i).Y)
  27.  
  28. Case Else
  29. Debug.Print(ListBox1.Items(i))
  30.  
  31. End Select
  32. Next
  33. Me.Refresh()
  34. End Sub
  35.  
  36. Me.Controls.Add(layers(i))
  37.  
  38. layers(i).Top = ListofLayers(i).X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement