View Single Post
  #3 (permalink)  
Old 05-18-2008, 05:48 PM
Erel's Avatar
Erel Erel is offline
Administrator
 
Join Date: Apr 2007
Posts: 3,185
Default

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
Reply With Quote