TextFormatter.FormatLine Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Cria um TextLine que é usado para formatar e exibir o conteúdo do documento.
Sobrecargas
| Name | Description |
|---|---|
| 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 TextSource valor que representa a fonte de texto da linha.
- firstCharIndex
- Int32
Um Int32 valor que especifica o índice de carácter do carácter inicial na linha.
- paragraphProperties
- TextParagraphProperties
Um valor que representa propriedades de TextParagraphProperties parágrafo, como direção do fluxo, alinhamento ou indentação.
- previousLineBreak
- TextLineBreak
Um valor que especifica o estado da TextLineBreak formatadora de texto, em termos de onde a linha anterior do parágrafo foi quebrada pelo processo de formatação do texto.
Devoluções
Um TextLine valor que representa uma linha de texto que pode ser exibida.
Exemplos
O exemplo seguinte mostra como usar o FormatLine método para devolver um . TextLineformatado
// 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 TextSource objeto que representa a fonte de texto da linha.
- firstCharIndex
- Int32
Um Int32 valor que especifica o índice de carácter do carácter inicial na linha.
- paragraphProperties
- TextParagraphProperties
Um objeto que representa propriedades de TextParagraphProperties parágrafo, como direção do fluxo, alinhamento ou indentação.
- previousLineBreak
- TextLineBreak
Um objeto que especifica o estado da TextLineBreak formatadora de texto, em termos de onde a linha anterior do parágrafo foi quebrada pelo processo de formatação do texto.
- textRunCache
- TextRunCache
Um TextRunCache objeto que representa o mecanismo de cache para o layout do texto.
Devoluções
Um TextLine valor que representa uma linha de texto que pode ser exibida.
Observações
Este método é utilizado para melhorar o desempenho em aplicações onde tem TextLine implicações significativas de desempenho.