TextFormatter.FormatLine Metodo

Definizione

Crea un oggetto TextLine utilizzato per formattare e visualizzare il contenuto del documento.

Overload

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

Crea un oggetto TextLine utilizzato per formattare e visualizzare il contenuto del documento.

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

Crea un oggetto TextLine utilizzato per formattare e visualizzare il contenuto del documento.

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

Crea un oggetto TextLine utilizzato per formattare e visualizzare il contenuto del documento.

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

Parametri

textSource
TextSource

Un valore TextSource che rappresenta il testo di origine per la riga.

firstCharIndex
Int32

Valore Int32 che specifica l'indice dei caratteri del carattere iniziale della riga.

paragraphWidth
Double

Un valore Double che specifica la larghezza del paragrafo che contiene la riga.

paragraphProperties
TextParagraphProperties

Un valore TextParagraphProperties che rappresenta le proprietà del paragrafo, ad esempio la direzione del flusso, l’allineamento o il rientro.

previousLineBreak
TextLineBreak

Un valore TextLineBreak che specifica lo stato del formattatore di testo, in termini di interruzione della riga precedente nel paragrafo in base al processo di formattazione del testo.

Restituisce

TextLine

Un valore TextLine che rappresenta una riga di testo che può essere visualizzata.

Esempio

Nell'esempio seguente viene illustrato come utilizzare il FormatLine metodo per restituire un oggetto formattato TextLine.

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

Si applica a

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

Crea un oggetto TextLine utilizzato per formattare e visualizzare il contenuto del documento.

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

Parametri

textSource
TextSource

Oggetto TextSource che rappresenta l’origine del testo per la riga.

firstCharIndex
Int32

Valore Int32 che specifica l'indice dei caratteri del carattere iniziale della riga.

paragraphWidth
Double

Un valore Double che specifica la larghezza del paragrafo che contiene la riga.

paragraphProperties
TextParagraphProperties

Un oggetto TextParagraphProperties che rappresenta le proprietà del paragrafo, ad esempio la direzione del flusso, l’allineamento o il rientro.

previousLineBreak
TextLineBreak

Un oggetto TextLineBreak che specifica lo stato del formattatore di testo, in termini di interruzione della riga precedente nel paragrafo in base al processo di formattazione del testo.

textRunCache
TextRunCache

Un oggetto TextRunCache che rappresenta il meccanismo della memorizzazione nella cache per il layout del testo.

Restituisce

TextLine

Un valore TextLine che rappresenta una riga di testo che può essere visualizzata.

Commenti

Questo metodo viene usato per migliorare le prestazioni nelle applicazioni in cui ha TextLine implicazioni significative sulle prestazioni.

Si applica a