Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Drawing shapes on forms
Message
De
05/09/2001 07:23:39
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Photos et traitement d'images
Titre:
Drawing shapes on forms
Divers
Thread ID:
00552409
Message ID:
00552409
Vues:
45
Hello, here is some code that draws a clock-shaped dial on a form. The hash-marks are different each time based upon parameters. It works well, but takes a bit too long to draw. Anyone see any clear ways to speed/refine this code up?
Thx, Seth

OpenDeg = 2.9

this.parent.cmdquit.setfocus()
counter = -0.050
PAPER=_SCREEN.ACTIVEFORM
PAPER.DRAWWIDTH=2

for xx = 90.5 to 448 step 3.6 &&100 Marks
IF COUNTER = 0
COUNTER = COUNTER + 0.001
ENDIF

if counter > thisform.max or counter < thisform.min
thisform.forecolor = rgb(255,0,0)
else
thisform.forecolor = rgb(66,192,0)
endif

for yy = 172 to 154 step -2 &&Draw colored blocks, line by line
PAPER.CURRENTX=thisform.shapebase1.left+(thisform.shapebase1.width/2)+(YY*COS(DTOR(XX)))
PAPER.CURRENTY=thisform.shapebase1.top+(thisform.shapebase1.height/2)+(YY*SIN(DTOR(XX)))
FOR angle = XX+1 TO XX+OpenDeg
PAPER.LINE(thisform.shapebase1.left+(thisform.shapebase1.width/2)+(YY*COS(DTOR(angle))),thisform.shapebase1.top+(thisform.shapebase1.height/2)+(YY*SIN(DTOR(angle))))
ENDFOR
endfor
counter = counter + 0.001
endfor
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform