TextFormatter.FormatLine Methode

Definition

Erstellt ein TextLine Element, das zum Formatieren und Anzeigen von Dokumentinhalten verwendet wird.

Überlädt

Name Beschreibung
FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)

Erstellt ein TextLine Element, das zum Formatieren und Anzeigen von Dokumentinhalten verwendet wird.

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache)

Erstellt ein TextLine Element, das zum Formatieren und Anzeigen von Dokumentinhalten verwendet wird.

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)

Erstellt ein TextLine Element, das zum Formatieren und Anzeigen von Dokumentinhalten verwendet wird.

public:
 abstract System::Windows::Media::TextFormatting::TextLine ^ FormatLine(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, double paragraphWidth, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties, System::Windows::Media::TextFormatting::TextLineBreak ^ previousLineBreak);
public abstract System.Windows.Media.TextFormatting.TextLine FormatLine(System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, double paragraphWidth, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties, System.Windows.Media.TextFormatting.TextLineBreak previousLineBreak);
abstract member FormatLine : System.Windows.Media.TextFormatting.TextSource * int * double * System.Windows.Media.TextFormatting.TextParagraphProperties * System.Windows.Media.TextFormatting.TextLineBreak -> System.Windows.Media.TextFormatting.TextLine
Public MustOverride Function FormatLine (textSource As TextSource, firstCharIndex As Integer, paragraphWidth As Double, paragraphProperties As TextParagraphProperties, previousLineBreak As TextLineBreak) As TextLine

Parameter

textSource
TextSource

Ein TextSource Wert, der die Textquelle für die Zeile darstellt.

firstCharIndex
Int32

Ein Int32 Wert, der den Zeichenindex des Anfangszeichens in der Zeile angibt.

paragraphWidth
Double

Ein Double Wert, der die Breite des Absatzes angibt, den die Linie ausfüllt.

paragraphProperties
TextParagraphProperties

Ein TextParagraphProperties Wert, der Absatzeigenschaften darstellt, z. B. Flussrichtung, Ausrichtung oder Einzug.

previousLineBreak
TextLineBreak

Ein TextLineBreak Wert, der den Textformatierzustand angibt, wobei die vorherige Zeile im Absatz durch den Textformatierungsprozess unterbrochen wurde.

Gibt zurück

Ein TextLine Wert, der eine Textzeile darstellt, die angezeigt werden kann.

Beispiele

Das folgende Beispiel zeigt, wie die FormatLine Methode verwendet wird, um eine formatierte TextLineZurückgabe zurückzugeben.

// Create a textline from the text store using the TextFormatter object.
TextLine myTextLine = formatter.FormatLine(
    customTextSource,
    0,
    400,
    customTextParagraphProperties,
    null);

// Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, new Point(0, 0), InvertAxes.None);
' Create a textline from the text store using the TextFormatter object.
Dim myTextLine As TextLine = formatter.FormatLine(customTextSource, 0, 400, customTextParagraphProperties, Nothing)

' Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, New Point(0, 0), InvertAxes.None)

Gilt für:

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache)

Erstellt ein TextLine Element, das zum Formatieren und Anzeigen von Dokumentinhalten verwendet wird.

public:
 abstract System::Windows::Media::TextFormatting::TextLine ^ FormatLine(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, double paragraphWidth, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties, System::Windows::Media::TextFormatting::TextLineBreak ^ previousLineBreak, System::Windows::Media::TextFormatting::TextRunCache ^ textRunCache);
public abstract System.Windows.Media.TextFormatting.TextLine FormatLine(System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, double paragraphWidth, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties, System.Windows.Media.TextFormatting.TextLineBreak previousLineBreak, System.Windows.Media.TextFormatting.TextRunCache textRunCache);
abstract member FormatLine : System.Windows.Media.TextFormatting.TextSource * int * double * System.Windows.Media.TextFormatting.TextParagraphProperties * System.Windows.Media.TextFormatting.TextLineBreak * System.Windows.Media.TextFormatting.TextRunCache -> System.Windows.Media.TextFormatting.TextLine
Public MustOverride Function FormatLine (textSource As TextSource, firstCharIndex As Integer, paragraphWidth As Double, paragraphProperties As TextParagraphProperties, previousLineBreak As TextLineBreak, textRunCache As TextRunCache) As TextLine

Parameter

textSource
TextSource

Ein TextSource Objekt, das die Textquelle für die Zeile darstellt.

firstCharIndex
Int32

Ein Int32 Wert, der den Zeichenindex des Anfangszeichens in der Zeile angibt.

paragraphWidth
Double

Ein Double Wert, der die Breite des Absatzes angibt, den die Linie ausfüllt.

paragraphProperties
TextParagraphProperties

Ein TextParagraphProperties Objekt, das Absatzeigenschaften darstellt, z. B. Flussrichtung, Ausrichtung oder Einzug.

previousLineBreak
TextLineBreak

Ein TextLineBreak Objekt, das den Textformatierzustand angibt, wobei die vorherige Zeile im Absatz durch den Textformatierungsprozess unterbrochen wurde.

textRunCache
TextRunCache

Ein TextRunCache Objekt, das den Zwischenspeicherungsmechanismus für das Layout von Text darstellt.

Gibt zurück

Ein TextLine Wert, der eine Textzeile darstellt, die angezeigt werden kann.

Hinweise

Diese Methode wird verwendet, um die Leistung in Anwendungen zu verbessern, in denen sich die TextLine Leistung erheblich auswirkt.

Gilt für: