HighTechTalks DotNet Forums  

Re: Pattern Line Drawing

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Re: Pattern Line Drawing in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Pattern Line Drawing - 12-27-2006 , 03:32 PM






You can use a custom dash-pattern to create whatever repeating pattern
you desire.

Take a look at the Pen.DashPattern property.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





James Hahn wrote:
Quote:
I can draw a line that has a pattern across the width of the line, but how
do I draw a line that has a pattern along the length, other than a simple
dash-dot combination. As per the attached example.

I could do the shape as an endcap and then draw the line in segments, but
that seems a lot of work for a simple repeating pattern.







Reply With Quote
  #2  
Old   
James Hahn
 
Posts: n/a

Default Re: Pattern Line Drawing - 12-27-2006 , 06:09 PM






The DashPattern property enables me to construct a line of dashes and dots.
I need a line drawing procedure that enables me to insert a small vector
symbol at points along the line (say, at the end of each dashpattern). I
guess what I'm looking for is a CustomDashCap that works like CustomEndCap.
--
"Bob Powell [MVP]" <bob (AT) _spamkiller_bobpowell (DOT) net> wrote

Quote:
You can use a custom dash-pattern to create whatever repeating pattern you
desire.

Take a look at the Pen.DashPattern property.

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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





James Hahn wrote:
I can draw a line that has a pattern across the width of the line, but
how do I draw a line that has a pattern along the length, other than a
simple dash-dot combination. As per the attached example.

I could do the shape as an endcap and then draw the line in segments, but
that seems a lot of work for a simple repeating pattern.






Reply With Quote
  #3  
Old   
Bob Powell [MVP]
 
Posts: n/a

Default Re: Pattern Line Drawing - 12-28-2006 , 01:50 AM



You're out of luck there. Dash caps are pretty simple and fixed by an enum.

You could cheat and draw small line-segments with their own custom end-caps.


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

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

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

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





James Hahn wrote:
Quote:
The DashPattern property enables me to construct a line of dashes and dots.
I need a line drawing procedure that enables me to insert a small vector
symbol at points along the line (say, at the end of each dashpattern). I
guess what I'm looking for is a CustomDashCap that works like CustomEndCap.

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.