- Home
·
- Graphics
·
- Draw a circle filled with multiple random color using line.
Draw a circle filled with multiple random color using line.
Draw a circle filled with multiple random color using line.
API Declarations
Dim red As Integer
Dim green As Integer
Dim blue As Integer
Dim x As Integer
Dim y As Integer
Dim xCenter As Integer
Dim yCenter As Integer
Dim angle As Integer
Rate Draw a circle filled with multiple random color using line.
(1(1 Vote))
Timer1.Interval = 1
Timer1.Enabled = True
Me.BackColor = vbBlack
Me.Width = 3000
Me.Height = 4000
xCenter = Me.Width / 2
yCenter = Me.Width / 2
End Sub
Private Sub Timer1_Timer()
Randomize
x = xCenter + (Sin(angle) * 1000)
y = yCenter - (Cos(angle) * 1000)
red = Int(Rnd * 255)
green = Int(Rnd * 255)
blue = Int(Rnd * 255)
Line (xCenter, yCenter)-(x, y), RGB(red, green, blue)
angle = angle + 1
If angle >= 360 Then angle = 0
End Sub
Draw a circle filled with multiple random color using line. Comments
No comments yet — be the first to post one!
Post a Comment