TextFormatter.FormatLine Método
Definición
Importante
Parte de la información hace referencia a la versión preliminar del producto, que puede haberse modificado sustancialmente antes de lanzar la versión definitiva. Microsoft no otorga ninguna garantía, explícita o implícita, con respecto a la información proporcionada aquí.
Crea un TextLine objeto que se usa para dar formato y mostrar el contenido del documento.
Sobrecargas
| Nombre | Description |
|---|---|
| FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak) |
Crea un TextLine objeto que se usa para dar formato y mostrar el contenido del documento. |
| FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache) |
Crea un TextLine objeto que se usa para dar formato y mostrar el contenido del documento. |
FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)
Crea un TextLine objeto que se usa para dar formato y mostrar el contenido del 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
Valor TextSource que representa el origen de texto de la línea.
- firstCharIndex
- Int32
Valor Int32 que especifica el índice de caracteres del carácter inicial en la línea.
- paragraphProperties
- TextParagraphProperties
Valor TextParagraphProperties que representa las propiedades de párrafo, como la dirección del flujo, la alineación o la sangría.
- previousLineBreak
- TextLineBreak
Valor TextLineBreak que especifica el estado del formateador de texto, en términos de dónde se interrumpió la línea anterior del párrafo por el proceso de formato de texto.
Devoluciones
Valor TextLine que representa una línea de texto que se puede mostrar.
Ejemplos
En el ejemplo siguiente se muestra cómo usar el FormatLine método para devolver un 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)
Se aplica a
FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache)
Crea un TextLine objeto que se usa para dar formato y mostrar el contenido del 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
Objeto TextSource que representa el origen de texto de la línea.
- firstCharIndex
- Int32
Valor Int32 que especifica el índice de caracteres del carácter inicial en la línea.
- paragraphProperties
- TextParagraphProperties
Objeto TextParagraphProperties que representa propiedades de párrafo, como la dirección del flujo, la alineación o la sangría.
- previousLineBreak
- TextLineBreak
Objeto TextLineBreak que especifica el estado del formateador de texto, en términos de dónde se interrumpió la línea anterior del párrafo por el proceso de formato de texto.
- textRunCache
- TextRunCache
Objeto TextRunCache que representa el mecanismo de almacenamiento en caché para el diseño del texto.
Devoluciones
Valor TextLine que representa una línea de texto que se puede mostrar.
Comentarios
Este método se usa para mejorar el rendimiento en las aplicaciones en las que tiene implicaciones significativas en el TextLine rendimiento.