473,898 Members | 2,507 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drawing a dotted line

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.
Nov 15 '05 #1
6 30688
"Rene" <no****@nospam. nospam> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
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.
Nov 15 '05 #2
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

"Rene" <no****@nospam. nospam> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
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.

Nov 15 '05 #3
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.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O%******** **********@TK2M SFTNGP11.phx.gb l...
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

"Rene" <no****@nospam. nospam> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
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.


Nov 15 '05 #4

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.

Nov 15 '05 #5
Custom line styles are easy to create and much simpler that trying to
hand-draw a bunch of individual dots and dashes...

--
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

"Rene" <no****@nospam. nospam> wrote in message
news:Os******** ******@TK2MSFTN GP10.phx.gbl...
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.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O%******** **********@TK2M SFTNGP11.phx.gb l...
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

"Rene" <no****@nospam. nospam> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
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.



Nov 15 '05 #6
For example...

Pen dp=new Pen(Brushes.Bla ck,1);

dp.DashPattern= new float[]{10f,3f,3f,3f};

e.Graphics.Draw Line(dp,0,0,100 ,100);
--
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

"Rene" <no****@nospam. nospam> wrote in message
news:Os******** ******@TK2MSFTN GP10.phx.gbl...
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.

"Bob Powell [MVP]" <bob@_spamkille r_bobpowell.net > wrote in message
news:O%******** **********@TK2M SFTNGP11.phx.gb l...
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

"Rene" <no****@nospam. nospam> wrote in message
news:u0******** ******@TK2MSFTN GP10.phx.gbl...
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.



Nov 15 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
53687
by: news-server | last post by:
Hi, I was wanting to get a dotted line..Such as they have on http://www.e-cbd.com/ What part of the CSS in dreamweaver is this going to be under? By the way..the part I am talking about is the dotted line above news, showcase and surrounding the toolbar.
4
2446
by: melanieab | last post by:
Hi, I'm trying to find the command(s) that will force buttons to be highlighted any time they're in focus. At the moment, buttons are only sometimes highlighted, and you can't always tell where you are. I did find this online: "When a button has the keyboard focus, the system typically highlights the text, icon, or bitmap of a button by surrounding it with a dotted line.", but no instructions on how to highlight yourself. Any help would...
1
3375
by: Carl Gilbert | last post by:
Hi I am looking to draw a dotted line between two controls at design time and render this at run time in a similar fashion. The most basic application of this would be a panel with two buttons on it. I would then draw a dotted line between the two. This line would then have to move when either of the two buttons move to update the connection between the two.
1
2456
by: troy_s11 | last post by:
I am trying to add a dotted line after a text box. The trouble I am having is the data that is in the text box is all different lengths. Therefore, I am either over lapping the dotted line, or I get a huge space left. This is and example of what I am trying to do: example1.......................XXXXX ex..................................XXXXX examp3..........................XXXXX What I am getting is this:
2
1856
by: Daniel.Peaper | last post by:
Hi folks, I'm trying to write a simple SELECT statement that will execute in query analyser but will just have the data with no column names, or the dotted line between them and the data. I also want to avoid the statement at the end which says nnn rows affected. any ideas? I want to do this because I intend to write the results to a flat file. Thanks for your help Danny....
3
3539
by: saathujaya | last post by:
Hi, I want to draw a dotted line.So how to colour the pixel with distance?(like ..... )
2
7351
by: Brian Kendig | last post by:
I'm trying to make a web page with a restaurant menu on it. Each line on the menu is the name of a dish (left-justified) and that dish's price (right-justified), with a dotted line between them. I'm doing something similar to this menu: http://cunardrestaurant.com/images/menu6.jpg But three things make it difficult: (1) the names of the dishes are all different lengths, (2) the prices can be different lengths, and (3) some of the...
6
5197
by: pravinnweb | last post by:
hi i am new to javascript i hav some problem with button in page that is when i set the focus to button the dotted line appear around the button is there any solution to hide that dotted line...please help me thanks in advance!
2
4337
by: FredZimmerman | last post by:
When I have my black backround for Body and my button is a round .GIF image (actually image has round green button on black backround, whole thing a rectangle), when I click on the button (hyperlink) a white dotted line surrounds the rectangular gif with round button image in the middle. How do I get rid of dotted white line on select of the hyperlink? Fred Z.
0
9993
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9839
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11254
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10854
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9658
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8034
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7187
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3303
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.