Line srawing

  • Thread starter Thread starter Boni
  • Start date Start date
B

Boni

Dear all,
I need to draw a collection of hor/vert lines. The lines in the collection
are nor ordered.
Each line has it's start point end point width and height.

|Endpoint 2
|
StartPoint1_________|Endpoint1/StartPoint2


The problem is that in above situation the corner itsef (point where line
crosses) is empty.

If you "zoom" on the corner you would see:

||||||
||||||
||||||||||||||



When I draw each line I can't predict if this line will be start of the next
line or not. So I need some general solution to handle this situation.
Any ideas?
Boni
 
Boni said:
Dear all,
I need to draw a collection of hor/vert lines. The lines in the
collection are nor ordered.
Each line has it's start point end point width and height.

|Endpoint 2
|
StartPoint1_________|Endpoint1/StartPoint2


The problem is that in above situation the corner itsef (point where line
crosses) is empty.

If you "zoom" on the corner you would see:

||||||
||||||
||||||||||||||

Looks like you are not calculating in the width of the line you are drawing
as a factor into the X location of the line...

hth,
Mythran
 
Boni said:
IMHO this should be calculated automatically by pen alignment. But I can't
get it work

Not sure how you are drawing...but I was able to draw 2 lines one
horizontal, one vertical...both with intersecting points (end point of horiz
is the same as the beginning point of the vertical) and they lined up even.
I tried with Graphics.DrawLine and I came up with the following:

||||||||||
|||||||||||||||
||||||||||

Then I tried Graphics.DrawLines and ended up with:

||||||||||
||||||||||||||||||||
||||||||||||||||||||

Which is what we want, I assume...look into the DrawLines method.

HTH,

Mythran
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top