I am trying to create effects like rail track and streets-with-border-and-label in WPF. How do I add a border to a line segment and a label that is along the line segment? I tried Border class, but it creates a rectangular border.
For the label, I tried Text on a path but it takes long time for processing as I have > 5000 lines in the canvas.
Any pointer开发者_如何转开发s to resources, hints, examples would be very helpful and appreciated.
Thanks!
I am not sure to understand what's your goal, but the vector way is mandatory, IMHO.
Anyway, if the WPF way is too heavy, you may try to create by yourself with the GraphicsPath of GDI+, that allows to manipulate an arbitrary path. The lines are a lot, but maybe once created an optimized version in memory, the calculation could be faster than WPF (which suffers of the animation capability, thus is heavy).
http://msdn.microsoft.com/en-us/library/system.drawing.drawing2d.graphicspath.aspx
Just in case, describe a bit better what's your target project.
Cheers
精彩评论