开发者

Border, Label for a line segment WPF

开发者 https://www.devze.com 2023-04-06 11:53 出处:网络
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

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.

Border, Label for a line segment WPF

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号