2009-07-15 10 views

Antwort

6

Sie suchen wahrscheinlich nach FormattedText.BuildGeometry Method oder FormattedText.BuildHighlightGeometry Method; Beide MSDN-Links enthalten auch die üblichen Beispiele.

Das grundlegende Nutzungsmuster ist in etwa so:

// Create sample formatted text. 
FormattedText formattedText = new FormattedText("Sample", 
    CultureInfo.GetCultureInfo("en-us"), FlowDirection.LeftToRight, 
    new Typeface("Verdana"), 16, System.Windows.Media.Brushes.Black); 

// Build geometry object that represents the text. 
Geometry normalGeometry = formattedText.BuildGeometry(
    new System.Windows.Point(0, 0)); 

// Build geometry object that represents the highlight bounding box of the text. 
Geometry highLightGeometry = formattedText.BuildHighlightGeometry(
    new System.Windows.Point(0, 0)); 
Verwandte Themen