TextFormatter.FormatLine Método

Definição

Cria um TextLine que é usado para formatar e exibir o conteúdo do documento.

Sobrecargas

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

Cria um TextLine que é usado para formatar e exibir o conteúdo do documento.

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

Cria um TextLine que é usado para formatar e exibir o conteúdo do documento.

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

Cria um TextLine que é usado para formatar e exibir o conteúdo do 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

Parâmetros

textSource
TextSource

Um valor TextSource que representa a origem do texto para a linha.

firstCharIndex
Int32

Um valor Int32 que especifica o índice de caracteres do caractere inicial na linha.

paragraphWidth
Double

Um valor Double que especifica a largura do parágrafo que a linha preenche.

paragraphProperties
TextParagraphProperties

Um valor TextParagraphProperties que representa as propriedades do parágrafo, como direção do fluxo, alinhamento ou recuo.

previousLineBreak
TextLineBreak

Um valor TextLineBreak que especifica o estado de formatador de texto, em termos do lugar em que a linha no parágrafo anterior foi interrompida pelo processo de formatação de texto.

Retornos

TextLine

Um valor TextLine que representa uma linha de texto que pode ser exibida.

Exemplos

O exemplo a seguir mostra como usar o FormatLine método para retornar um formato 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)

Aplica-se a

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

Cria um TextLine que é usado para formatar e exibir o conteúdo do 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

Parâmetros

textSource
TextSource

Um objeto TextSource que representa a origem do texto para a linha.

firstCharIndex
Int32

Um valor Int32 que especifica o índice de caracteres do caractere inicial na linha.

paragraphWidth
Double

Um valor Double que especifica a largura do parágrafo que a linha preenche.

paragraphProperties
TextParagraphProperties

Um objeto TextParagraphProperties que representa as propriedades do parágrafo, como direção do fluxo, alinhamento ou recuo.

previousLineBreak
TextLineBreak

Um objeto TextLineBreak que especifica o estado de formatador de texto, em termos do lugar em que a linha no parágrafo anterior foi interrompida pelo processo de formatação de texto.

textRunCache
TextRunCache

Um objeto TextRunCache que representa o mecanismo de cache para o layout do texto.

Retornos

TextLine

Um valor TextLine que representa uma linha de texto que pode ser exibida.

Comentários

Esse método é usado para melhorar o desempenho em aplicativos em que o TextLine desempenho tem implicações significativas de desempenho.

Aplica-se a