
08-20-2008, 11:52 AM
|
|
Senior Member
|
|
Join Date: Apr 2008
Location: Gosford NSW Australia
Posts: 123
|
|
Quote:
Originally Posted by Erel
This is an example of drawing thick lines:
Code:
Sub Globals
Dim Type(x,y) points(0)
End Sub
Sub App_Start
Form1.Show
DrawThickLine ("Form1",20,30,20,200,10,cGold)
DrawThickLine ("Form1",20,30,70,44,10,cRed)
End Sub
Sub DrawThickLine(Form, x1, y1, x2, y2, width, color)
l = ATan((y2-y1)/(x2-x1+0.01))
dx = width/2 * Sin(l)
dy = width/2 * Cos(l)
points() = Array((x1 + dx,y1 - dy),(x2 + dx,y2 - dy), _
(x2 - dx,y2 + dy),(x1 - dx,y1 + dy))
Control(Form,Form).Polygon(points(),0,4,color,f)
End Sub
|
Hey this is pretty good. Thanks Erel.
Now the maths in the above routine is way over my head but, the lines are not very smooth.
Can anyone improve this?
Please
Or is this as good as it gets?
Thanks
Tony
|