View Single Post
  #5 (permalink)  
Old 08-20-2008, 02:39 PM
klaus's Avatar
klaus klaus is offline
Basic4ppc Expert
 
Join Date: Oct 2007
Location: Switzerland
Posts: 664
Awards Showcase
Beta Tester Competition Winner 
Total Awards: 2
Default

Add the red line and you will have smouth lines with rounded ends.

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)
    Control(Form,Form).Circle(x1,y1,penWidth/2,Pencolour,f)
End Sub
Best regards.
__________________
Klaus
Switzerland
Reply With Quote