Jump to content
  • Advertisement
Sign in to follow this  
sedmy1

c#: custom Pen

This topic is 3168 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I develop CAD/GIS application and I need advice how to draw custom lines. For example I need draw these kind of lines: --x--x--x--x or --/--/--/--/ My first thought was to create images with patterns and map it in the line. It works fine for lines but not for drawing arcs, circles, splines etc. For these I'd need a Pen object. Could you give me any advice how to do it? (I use c# - .net 2.) Thanks, Sedmy1

Share this post


Link to post
Share on other sites
Advertisement
If you need a pen to draw in a different style then you need create a brush that draw in that style and then make a pen that uses that brush. You could probably use a TextureBrush

EDIT: Sorry, I meant to say System.Drawing.HatchBrush

Share this post


Link to post
Share on other sites
Thanks for reply.

I cannot use HatchBrush because it supports only predefined list of styles.

I tried to use TextureBrush but I dosn't work as I need: I had my style in a image (the image looks like [-x--x--x-]), then I created TextureBrush and Pen from the brush. When I draw circle it looks strange because the Pen doesn't curve my style image.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!