TextFormatter.FormatLine Metoda

Definicja

Tworzy obiekt TextLine służący do formatowania i wyświetlania zawartości dokumentu.

Przeciążenia

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

Tworzy obiekt TextLine używany do formatowania i wyświetlania zawartości dokumentu.

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

Tworzy obiekt TextLine używany do formatowania i wyświetlania zawartości dokumentu.

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

Tworzy obiekt TextLine używany do formatowania i wyświetlania zawartości dokumentu.

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

Parametry

textSource
TextSource

TextSource Wartość reprezentująca źródło tekstu dla wiersza.

firstCharIndex
Int32

Wartość Int32 określająca indeks znaków początkowego znaku w wierszu.

paragraphWidth
Double

Double Wartość określająca szerokość akapitu, który wypełnia wiersz.

paragraphProperties
TextParagraphProperties

TextParagraphProperties Wartość reprezentująca właściwości akapitu, takie jak kierunek przepływu, wyrównanie lub wcięcie.

previousLineBreak
TextLineBreak

TextLineBreak Wartość określająca stan formatatora tekstu pod względem miejsca, w którym poprzedni wiersz w akapicie został przerwany przez proces formatowania tekstu.

Zwraca

TextLine

TextLine Wartość reprezentująca wiersz tekstu, który można wyświetlić.

Przykłady

W poniższym przykładzie pokazano, jak za pomocą FormatLine metody zwrócić sformatowany TextLineelement .

// 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)

Dotyczy

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

Tworzy obiekt TextLine używany do formatowania i wyświetlania zawartości dokumentu.

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

Parametry

textSource
TextSource

TextSource Obiekt reprezentujący źródło tekstu dla wiersza.

firstCharIndex
Int32

Int32 Wartość określająca indeks znaków początkowego znaku w wierszu.

paragraphWidth
Double

Double Wartość określająca szerokość akapitu, który wypełnia wiersz.

paragraphProperties
TextParagraphProperties

TextParagraphProperties Obiekt reprezentujący właściwości akapitu, takie jak kierunek przepływu, wyrównanie lub wcięcie.

previousLineBreak
TextLineBreak

TextLineBreak Obiekt, który określa stan formatatora tekstu, pod względem miejsca, w którym poprzedni wiersz w akapicie został przerwany przez proces formatowania tekstu.

textRunCache
TextRunCache

TextRunCache Obiekt reprezentujący mechanizm buforowania dla układu tekstu.

Zwraca

TextLine

TextLine Wartość reprezentująca wiersz tekstu, który można wyświetlić.

Uwagi

Ta metoda służy do poprawy wydajności w aplikacjach, w których ma znaczący wpływ na TextLine wydajność.

Dotyczy