Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Animated Object
Message
 
To
04/06/2002 16:43:59
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00664719
Message ID:
00664787
Views:
18
>How can I make a line on a form appear to swing in an arc from 100 degrees to 170 using the arrow keys?

Use the line() method of the form to draw a line and overwrite the previous line before drawing the next one. The method take four params: xOrigin, yOrigin, xDestination, yDestination

But you need to do some calculations in order to draw with differents angles on an arc.

With the following code the angle 0 deg was horizontal.
(0 deg was at 3 on a watch, 90 deg was at 6, 180 at 9, 270 at 12 and 360 at 3)
*To draw a line at 4 (30 deg) on a 200 pixels watch : 

CenterX=100
CenterY=100
Radius=100
nDeg=30

MyForm.LINE(CenterX,;
	CenterY,;
	CenterX+(Radius*COS(DTOR(nDeg))),;
	CenterY+(Radius*SIN(DTOR(nDeg))))
Play with the forecolor of the form to change the color of the line...
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...


Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca
Previous
Reply
Map
View

Click here to load this message in the networking platform