Drawing a dotted line

  • Thread starter Thread starter Rene
  • Start date Start date
R

Rene

I tried searching the newsgroups to see how do you draw a dotted line but I
was unable to find an answer, drawing a straight line is very easy but not a
dotted one.

So the question is, how do I draw a dotted line?

Thank you.
 
Rene said:
I tried searching the newsgroups to see how do you draw a dotted line but I
was unable to find an answer, drawing a straight line is very easy but not a
dotted one.

So the question is, how do I draw a dotted line?

The way this tends to work in page description languages is the most obvious
trickery - draw a bunch of small short lines in a row.

R.
 
You can select a line style for a pen that includes standard dot, dot-dash
and so-on or create a custom line style. Lines drawn by pens may also have
end-caps shaped like arrows, diamonds or dots.

Look at System.Drawing.Pen and the DashStyle property which contains a
DashStyle enumeration value.

--
Bob Powell [MVP]
C#, System.Drawing

The November edition of Well Formed is now available.
Learn how to create Shell Extensions in managed code.
http://www.bobpowell.net/currentissue.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/gdiplus_faq.htm

Read my Blog at http://bobpowelldotnet.blogspot.com
 
Not bad, if fact not bad at all... but now I need to scale the line so that
the space between the different patterns is bigger, for example I am
currently using the dash-dot style but the dash and dot are so close
together that in a high resolution screen you can barely tell the line is
not a solid line! Is there a way to scale the line spaces or am I going to
have to create a custom style??

Thank you.
 
Hi Rene,

I think you should do some custom drawing.
For example, you can take Richard's suggestion, do some trickery, draw a
bunch of small short lines combine with some dot.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Back
Top