How to add text to path?
Posted
by Pritorian
on Stack Overflow
See other posts from Stack Overflow
or by Pritorian
Published on 2010-04-05T13:32:17Z
Indexed on
2010/04/05
13:33 UTC
Read the original article
Hit count: 373
Hi all. Te question is how to add text to path element. For example, I have path:
Path firstPath = new Path();
firstPath.Stroke = Brushes.Black;
firstPath.StrokeThickness = 1;
myCanvas.Children.Add(firstPath);
LineGeometry firstLine = new LineGeometry();
firstPath.Data = firstLine;
And somewhere I define line's Start and End point's. The path is binded to controls (for example - two ellipses) and when I drag one of them, the line is dynamically resized and moved to be pinned to both objects.
And now I wand to add some text, that would fit to this line and follow it. Any recommendations how to do this?
© Stack Overflow or respective owner