VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Draw a flower with pset method

by Arman Samavatian (3 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 23rd July 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Draw a flower with pset method

API Declarations


Microsoft Windows Common Controls-2 6.0

Rate Draw a flower with pset method



''''''''''''''''''''''''''''
Private Sub Form_Load()
Text1.Text = Timer1.Interval
Call Picture1.Cls
With UpDown1
  .Min = 0
  .Max = 100000000
  .Wrap = True
  .Increment = 100
  End With
End Sub
''''''''''''''''''''''''''''
Private Sub Drawshape()
Dim x As Single, y As Single
Dim total As Single, r As Single
Dim a As Single, theta As Single

Call Randomize
Picture1.Scale (4, -4)-(-4, 4)
total = 8 * Atn(1)

Picture1.ForeColor = QBColor(Rnd() * 15)

a = 3 * Rnd()

For theta = 0 To total Step 0.01
r = a * Sin(10 * theta)
x = r * Cos(theta)
y = r * Sin(theta)

Picture1.PSet (x, y)

r = a * Sin(10 * theta)
x = r * Cos(theta)
y = r * Tan(45 * theta)

Picture1.PSet (x, y)
Next theta

End Sub
''''''''''''''''''''''''''''
Private Sub cmd_clear_Click()
Call Picture1.Cls
End Sub
''''''''''''''''''''''''''''
Private Sub Text1_Change()
On Error GoTo Ex
UpDown1.Value = Text1.Text

If Text1.Text = "" Then
 Timer1.Enabled = False
Else
 Timer1.Enabled = True
End If
Ex:
Exit Sub
End Sub

''''''''''''''''''''''''''''
Private Sub Timer1_Timer()
Call Drawshape
End Sub

''''''''''''''''''''''''''''
Private Sub UpDown1_Change()
Timer1.Interval = UpDown1.Value
Text1.Text = UpDown1.Value
End Sub






Download this snippet    Add to My Saved Code

Draw a flower with pset method Comments

No comments have been posted about Draw a flower with pset method. Why not be the first to post a comment about Draw a flower with pset method.

Post your comment

Subject:
Message:
0/1000 characters