Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using picture.circle 1

Status
Not open for further replies.

devilman0

IS-IT--Management
Nov 14, 2002
257
US
i want to use "Sub Circle(Step As Integer, X As Single, Y As Single, Radius As Single, Color As Long, Start As Single, End As Single, Aspect As Single) "

to draw a partial circle, but cannot get it to work:

gauge1.circle 100,1000,1000,1000,vbred,0,500

i get an error syntax error even if i do
gauge1.circle (100,1000,1000,1000,vbred,0,500)

basically i want to draw a partial circle inside of a picturebox, the reason is i want to make a nifty looking gauge that has a red line going around it, sorta like what i've seen on a crane. thanks in advance, james
 
function rads (byVal nDegrees as double) as double
dim nRadians as double
nradians = (22/7) * nDegrees
rads = nRadians / 180
end function

form1.circle (2000,2000), 1000, rads(45), rads(230)

will draw an arc from 45 degrees to 230 degrees.....

-----------------------------------------------------------------
"The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
- unknown

mikewolf@tst-us.com
 
This example from MS VB help. Modify as desired (e.g. ass Picture. before circle, include additional args ...


Code:
Sub Form_Click ()
   Dim CX, CY, Radius, Limit   ' Declare variable.
   ScaleMode = 3   ' Set scale to pixels.
   CX = ScaleWidth / 2   ' Set X position.
   CY = ScaleHeight / 2   ' Set Y position.
   If CX > CY Then Limit = CY Else Limit = CX
   For Radius = 0 To Limit   ' Set radius.
      Circle (CX, CY), Radius,RGB(Rnd * 255, Rnd * 255, Rnd * 255)
   Next Radius
End Sub

Also simply refer to the VB help docs to understand some more.

MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
the first (answer) didn't work, but worked like this:
Picture1.Circle (2000, 2000), 1000, vbRed, rads(45), rads(230)

thanks "MWOLF00" for the answer.
 
OOPPS! I forgot the extra comma (for default color). I'm glad it worked...

form1.circle (2000,2000), 1000, ,rads(45), rads(230) -----------------------------------------------------------------
"The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
- unknown

mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top