Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Irregular shaped objects
Message
De
28/10/1998 00:22:07
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00151157
Message ID:
00151395
Vues:
19
>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)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform