954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

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

prettyboy
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

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.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

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.

prettyboy
Newbie Poster
4 posts since Jul 2007
Reputation Points: 10
Solved Threads: 0
 

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
debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

hey i got this rit but.how can i get that arc colored. means i want that arc filed with color...
thanx in advance

abivats
Newbie Poster
3 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

add these two lines to existing code.

Me.FillStyle = vbFSSolid
Me.FillColor = vbRed

add prior to circle code.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

hey it din worked out.....getting the same output.

abivats
Newbie Poster
3 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

try changing the Scalemode to Twips.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 
try changing the Scalemode to Twips.


sorry i m not able 2 understand. twips?
help plz.i m stuck!
thanx in advance.

abivats
Newbie Poster
3 posts since May 2011
Reputation Points: 10
Solved Threads: 0
 

Twips --- is the unit.

debasisdas
Posting Genius
6,872 posts since Feb 2007
Reputation Points: 666
Solved Threads: 434
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You