Border, label for WPF line segment

I am trying to create effects in WPF such as rail tracks and streets with borders and labels. How to add a border to a line segment and a label located along a line segment? I tried the Border class, but it creates a rectangular border.

rail road

For the shortcut, I tried Text along the way , but it takes a lot of time to process, since I have> 5000 lines on the canvas.

Any pointers to resources, tips, examples will be very helpful and appreciated.

Thanks!

+4
source share
1 answer

I'm not sure to understand what your goal is, but a vector way is a must, IMHO.

In any case, if the WPF method is too heavy, you can try to create it yourself using GraphicsPath from GDI +, which allows you to manipulate it in an arbitrary way. There are a lot of lines, but perhaps once an optimized version was created in memory, the calculation can be faster than WPF (which suffers from the possibility of animation, thereby is difficult).

http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath.aspx

Just in case, describe a little better what your target project is.

Greetings

+1
source

All Articles