![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Code Samples & Tips Share your recent discoveries and ideas with other users. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi
I wonder if anybody can help me? While I am busy with a Topographical survey, the points get plotted on the screen as they come from the Total Station or GPS. I can then add lines, text, circles, etc to the surveyed points, which means that the drawing will be nearly finished when I go back to the office. My question is, is there any way that I can have different line types, i.e. solid, dashed, dot dashed, etc. Thanks Michael ![]() |
|
||||
|
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
|
|
|||
|
Quote:
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 |
|
||||
|
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
__________________
Klaus Switzerland |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Travian off-line stats... | Cableguy | Questions & Help Needed | 3 | 07-25-2008 05:55 AM |
| FileWrite at certain line..? | TWELVE | Questions & Help Needed | 2 | 05-13-2008 06:29 AM |
| Error at line 0? | Mistrel | Questions & Help Needed | 9 | 11-04-2007 08:40 PM |
| Error when using an array of types | zurpa | Questions & Help Needed | 5 | 10-27-2007 09:19 PM |
| How to draw a line? | RandomCoder | Questions & Help Needed | 3 | 08-24-2007 10:11 PM |