TextFormatter.FormatLine Método

Definição

Cria um TextLine que é usado para formatação e exibição de conteúdo do documento.

Sobrecargas

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

Cria um TextLine que é usado para formatação e exibição de conteúdo do documento.

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

Cria um TextLine que é usado para formatação e exibição de conteúdo do documento.

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

Cria um TextLine que é usado para formatação e exibição de 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 TextSource valor que representa a fonte de texto da linha.

firstCharIndex
Int32

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

paragraphWidth
Double

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

paragraphProperties
TextParagraphProperties

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

previousLineBreak
TextLineBreak

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

Retornos

Um TextLine valor 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 formatação e exibição de 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 TextSource objeto que representa a fonte de texto da linha.

firstCharIndex
Int32

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

paragraphWidth
Double

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

paragraphProperties
TextParagraphProperties

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

previousLineBreak
TextLineBreak

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

textRunCache
TextRunCache

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

Retornos

Um TextLine valor 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