|
-
Nov 26th, 2001, 11:15 PM
#1
Thread Starter
Fanatic Member
Drawing in Picture Box Question
Hi all
Just wanted to know if there was any easy method of drawing curved lines that look any good?
eg
A curved Command Button outline
I have looked into the help and all i have found is the line control and plotting individual pixels but they either take too much code or look really bad
-
Nov 26th, 2001, 11:33 PM
#2
Frenzied Member
Seems to me that you could take two coordinates (x1,y1) and (x2,y2) that define a box, then get the radius you want (how much rounding you want for the corners).
Then just draw a line from x1 + radius to x2 - radius, draw 90 degrees of a circle using (x2 - radius, y1 + radius) for the center, and continue on around the box, rounding the corners as you go.
-
Nov 26th, 2001, 11:39 PM
#3
Thread Starter
Fanatic Member
I dont quite see how that would work when all you can draw is a straight line
That would end up giving the box diagonal edges unless i have worked out what you were trying to say wrong!!
-
Nov 26th, 2001, 11:44 PM
#4
PowerPoster
Why not use "DrawArc" API?
-
Nov 26th, 2001, 11:50 PM
#5
Thread Starter
Fanatic Member
lol I love it when there is nice easy way to go about things 
thanks abdul
-
Nov 26th, 2001, 11:56 PM
#6
Thread Starter
Fanatic Member
ummm Abdul
I cant find that Api ??
and on looking in MSDN its only refernce is as part of the .NET framework where it is the
And im not using .NET
-
Nov 27th, 2001, 12:11 AM
#7
PowerPoster
ops..the functions are called "Arc" and "ArcTo", and their declarations are like this:
VB Code:
Public Declare Function Arc Lib "gdi32" Alias "Arc" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
Public Declare Function ArcTo Lib "gdi32" Alias "ArcTo" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long, ByVal X4 As Long, ByVal Y4 As Long) As Long
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|