TizzyT

meh

Feb 13th, 2015
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.02 KB | None | 0 0
  1. Class MainWindow
  2.  
  3.     Private Sub MainWindow_Loaded(sender As Object, e As RoutedEventArgs) Handles Me.Loaded
  4.         Dim rnd As New Random
  5.  
  6.         Dim scb As New SolidColorBrush
  7.         scb.Color = Color.FromArgb(255, 0, 0, 0)
  8.  
  9.         For i = 1 To 35
  10.             Dim meh1 As Ellipse = CenterEllipse(New Ellipse, rnd.Next(100, 256), rnd.Next(100, 256), rnd.Next(0, 800), rnd.Next(0, 800), scb, Brushes.Aqua, 2)
  11.             Canvas1.Children.Add(meh1)
  12.         Next
  13.  
  14.     End Sub
  15.  
  16.     Public Function CenterEllipse(ellipse As Ellipse, SizeX As Double, SizeY As Double, PosX As Double, PosY As Double, SolidBrush As SolidColorBrush, outline As Brush, thickness As Double) As Ellipse
  17.         ellipse.Fill = SolidBrush
  18.         ellipse.StrokeThickness = thickness
  19.         ellipse.Stroke = outline
  20.         ellipse.Width = SizeX
  21.         ellipse.Height = SizeY
  22.         Canvas.SetTop(ellipse, PosY - ellipse.Height / 2)
  23.         Canvas.SetLeft(ellipse, PosX - ellipse.Width / 2)
  24.         Return ellipse
  25.     End Function
  26.  
  27. End Class
Advertisement
Add Comment
Please, Sign In to add comment