PETZOLD BOOK BLOG

Charles Petzold on writing books, reading books, and exercising the internal UTM


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

My “MSDN Magazine” Article on Text on a Path

November 23, 2008
New York, N.Y.

A recent article I wrote for MSDN Magazine has now gone online:

Render Text On A Path With WPF

By "path" I mean a graphics path, or in WPF lingo, a PathGeometry. (To be entirely precise, I restrict myself to positioning text characters on a PathFigure which is a single connected series of straight lines and curves.) The article shows you how to do stuff like this:

In the article I show several different ways to implement text on a path, including a high-level approach (deriving from UserControl) and multiple low-level approaches that require deriving from FrameworkElement. I show how to override OnRender and also how to create visual children of type DrawingVisual. If you're interested in WPF low-level graphics, this article might be of particular interest.

If the idea of exploring several solutions to the same problem drives you nuts, and you really want to see only one "best practices" solution, I conclude the article by indicating which approach I think is best.


Comments:

Hello,

how do you draw text inside shapes (ellipse, rectangle or custom shapes) and edit during run-time?

thanks

KJ, Thu, 22 Jan 2009 13:03:26 -0500 (EST)


Recent Entries
< PreviousBrowse the ArchivesNext >
Subscribe to the RSS Feed

(c) Copyright Charles Petzold
www.charlespetzold.com