c#: custom Pen

Started by
1 comment, last by sedmy1 14 years, 6 months ago
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
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
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.

This topic is closed to new replies.

Advertisement