Share via


TextFormatter.FormatLine Méthode

Définition

Crée un TextLine qui est utilisé pour mettre en forme et afficher le contenu de document.

Surcharges

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

Crée un TextLine qui est utilisé pour mettre en forme et afficher le contenu de document.

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

Crée un TextLine qui est utilisé pour mettre en forme et afficher le contenu de document.

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

Crée un TextLine qui est utilisé pour mettre en forme et afficher le contenu de document.

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

Paramètres

textSource
TextSource

Valeur TextSource qui représente la source de texte pour la ligne.

firstCharIndex
Int32

Valeur Int32 qui spécifie l'index de caractère du caractère initial de la ligne.

paragraphWidth
Double

Valeur Double qui spécifie la largeur du paragraphe que la ligne remplit.

paragraphProperties
TextParagraphProperties

Valeur TextParagraphProperties qui représente les propriétés de paragraphe, telles que le sens du déroulement, l'alignement ou la mise en retrait.

previousLineBreak
TextLineBreak

Valeur TextLineBreak qui spécifie l'état du formateur de texte, en terme d'endroit où la ligne précédente du paragraphe a été coupée par le processus de mise en forme du texte.

Retours

TextLine

Valeur TextLine qui représente une ligne de texte qui peut être affichée.

Exemples

L’exemple suivant montre comment utiliser la FormatLine méthode pour retourner un format .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)

S’applique à

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

Crée un TextLine qui est utilisé pour mettre en forme et afficher le contenu de document.

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

Paramètres

textSource
TextSource

Objet TextSource qui représente la source de texte pour la ligne.

firstCharIndex
Int32

Valeur Int32 qui spécifie l'index de caractère du caractère initial de la ligne.

paragraphWidth
Double

Valeur Double qui spécifie la largeur du paragraphe que la ligne remplit.

paragraphProperties
TextParagraphProperties

Objet TextParagraphProperties qui représente les propriétés de paragraphe, telles que le sens du déroulement, l'alignement ou la mise en retrait.

previousLineBreak
TextLineBreak

Objet TextLineBreak qui spécifie l'état du formateur de texte, en terme d'endroit où la ligne précédente du paragraphe a été coupée par le processus de mise en forme du texte.

textRunCache
TextRunCache

Objet TextRunCache qui représente le mécanisme de mise en cache pour la disposition du texte.

Retours

TextLine

Valeur TextLine qui représente une ligne de texte qui peut être affichée.

Remarques

Cette méthode est utilisée pour améliorer les performances dans les applications où les implications en matière de TextLine performances sont significatives.

S’applique à