TextFormatter.FormatLine Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Crée un TextLine élément utilisé pour la mise en forme et l’affichage du contenu du document.
Surcharges
| Nom | Description |
|---|---|
| FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak) |
Crée un TextLine élément utilisé pour la mise en forme et l’affichage du contenu du document. |
| FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache) |
Crée un TextLine élément utilisé pour la mise en forme et l’affichage du contenu du document. |
FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)
Crée un TextLine élément utilisé pour la mise en forme et l’affichage du contenu du 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 de la ligne.
- firstCharIndex
- Int32
Valeur Int32 qui spécifie l’index de caractère du caractère de départ dans la ligne.
- paragraphProperties
- TextParagraphProperties
Valeur TextParagraphProperties qui représente les propriétés de paragraphe, telles que la direction du flux, l’alignement ou la mise en retrait.
- previousLineBreak
- TextLineBreak
Valeur TextLineBreak qui spécifie l’état du formateur de texte, en termes d’emplacement où la ligne précédente du paragraphe a été rompue par le processus de mise en forme du texte.
Retours
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 élément utilisé pour la mise en forme et l’affichage du contenu du 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 de la ligne.
- firstCharIndex
- Int32
Valeur Int32 qui spécifie l’index de caractère du caractère de départ dans la ligne.
- paragraphProperties
- TextParagraphProperties
Objet TextParagraphProperties qui représente les propriétés de paragraphe, telles que la direction du flux, l’alignement ou la mise en retrait.
- previousLineBreak
- TextLineBreak
Objet TextLineBreak qui spécifie l’état du formateur de texte, en termes d’emplacement où la ligne précédente du paragraphe a été rompue 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
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 conséquences sur les TextLine performances sont significatives.