DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Visual Basic 4 / 5 / 6 (http://www.daniweb.com/forums/forum4.html)
-   -   form shape drawing (arc) (http://www.daniweb.com/forums/thread89204.html)

prettyboy Sep 10th, 2007 11:02 pm
form shape drawing (arc)
 
dear all,
i'm doing a project which involve shape (arc, circles and rectangles) i'm a newbie on VB6, done the easy shapes but problem on drawing the arc on the form to form a half-moon shape. any help or link on this will be great and appreciated. thnx in advance

debasisdas Sep 11th, 2007 11:11 am
Re: form shape drawing (arc)
 
syntax to draw circle, arc etc
-----------------------------------------
OBJECT.CIRCLE [STEP](X,Y),RADIUS,[COLOR,START,END,[ASPECT]]]
--
STEP-IT SPECIFIES THE CENTER OF THE CIRCLE IS RELATIVE TO THE CURRENT COORDINATES GIVEN BY "CURRENTX","CURRENTY"
X,Y-INDICATES THE CENTER COORDINATE OF THE CIRCLE.
RADIUS-INDICATES THE RADIUS.
START,END-WHEN AN ARK OR A PARTIAL CIRCLE IS DRAWN START AND END SPECIFIES THE BEGINNING AND THE END POSITION OF THE ARC.
THE RANGE FOR BOTH IS -2Pi RADIAN TO +2 Pi RADIAN.THE DEFAULT VALUE FOR START IS 0 RADIANS AND THAT FOR END IS 2*Pi RADIANS.
ASPECT-INDICATES THE ASPECT RATIO OF THE CIRCLE.DEFAULT IS 1.0 WHICH YIELDS A PERFECT CIRCLE ON ANY SCREEN.

Hope this solves your problem.

prettyboy Sep 12th, 2007 10:03 pm
Re: form shape drawing (arc)
 
hi. thanks for your help. i was able to create the arc but how to make it appear without the click? I want the shape to appear immediately upon loading but it only comes out when i click. I know this is easy stuff for you guys, but as i have mentioned earlier, i'm a newbie, please bear with me. thanks in advance.

debasisdas Sep 13th, 2007 12:37 pm
Re: form shape drawing (arc)
 
put the code in form paint event

try this
Private Sub Form_Paint()
Me.Circle (ScaleWidth / 2, ScaleHeight / 2), Switch(ScaleWidth >= ScaleHeight, ScaleHeight / 2, ScaleWidth < ScaleHeight, ScaleWidth / 2), vbRed, 0, 3, 0.8
End Sub


All times are GMT -4. The time now is 6:08 am.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC