Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Irregular shaped objects
Message
From
28/10/1998 00:22:07
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00151157
Message ID:
00151395
Views:
20
>I need to use odd shaped objects to represent parts of teeth. I have to be able to click on the shape and change the color. The objects need to be very close to each other on the screen. Does anyone have any experience with this situation? I could get by if I could figure out how put 4 quarter circle objects together to make one circle. Any feedback is appreciated.
>
>Marcus.

put something like this in the form refresh event:
clear

offsetx = 10
offsety = 20
radius = 100
diameter = 2 * radius

color0 = rgb(0, 0, 0)
color1 = rgb(0, 0, 192)
color2 = rgb(0, 192, 0)
color3 = rgb(192, 0, 0)
color4 = rgb(64, 64, 64)

_screen.drawwidth = 1

deltaradius = radius - 2
deltaradiussquared = deltaradius * deltaradius

for y = 0 to deltaradius
	
	x = sqrt(deltaradiussquared - (y * y))
	
	* quadrant 1
	_screen.forecolor = color1
	_screen.line(offsetx + radius + 1, offsety + radius - (y + 1), ;
		offsetx + radius + x, offsety + radius - (y + 1))
	
	* quadrant 2
	_screen.forecolor = color2
	_screen.line(offsetx + radius - 1, offsety + radius - (y + 1), ;
		offsetx + radius - x, offsety + radius - (y + 1))
	
	* quadrant 3
	_screen.forecolor = color3
	_screen.line(offsetx + radius - 1, offsety + radius + (y + 1), ;
		offsetx + radius - x, offsety + radius + (y + 1))
	
	* quadrant 4
	_screen.forecolor = color4
	_screen.line(offsetx + radius + 1, offsety + radius + (y + 1), ;
		offsetx + radius + x, offsety + radius + (y + 1))
	
endfor

*_screen.forecolor = color0
*_screen.line(offsetx + 0, offsety + radius, offsetx + diameter, offsety + radius)
*_screen.line(offsetx + radius, offsety, offsetx + radius, offsety + diameter)
Previous
Reply
Map
View

Click here to load this message in the networking platform