MinMaxParagraphWidth Estrutura
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.
Representa a menor e maior largura de parágrafo possível que pode conter totalmente o conteúdo do texto especificado.
public value class MinMaxParagraphWidth : IEquatable<System::Windows::Media::TextFormatting::MinMaxParagraphWidth>
public struct MinMaxParagraphWidth : IEquatable<System.Windows.Media.TextFormatting.MinMaxParagraphWidth>
type MinMaxParagraphWidth = struct
Public Structure MinMaxParagraphWidth
Implements IEquatable(Of MinMaxParagraphWidth)
- Herança
- Implementações
Exemplos
O exemplo seguinte mostra como usar a MinWidth propriedade para gerar a largura mínima de parágrafo para as linhas de texto formatadas.
MinMaxParagraphWidth minMaxParaWidth =
formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties);
// Format each line of text from the text store and draw it.
while (textStorePosition < customTextSource.Text.Length)
{
// Create a textline from the text store using the TextFormatter object.
using (TextLine myTextLine = formatter.FormatLine(
customTextSource,
textStorePosition,
minMaxParaWidth.MinWidth,
customTextParagraphProperties,
null))
{
// Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, linePosition, InvertAxes.None);
// Update the index position in the text store.
textStorePosition += myTextLine.Length;
// Update the line position coordinate for the displayed line.
linePosition.Y += myTextLine.Height;
}
}
Dim minMaxParaWidth As MinMaxParagraphWidth = formatter.FormatMinMaxParagraphWidth(customTextSource, 0, customTextParagraphProperties)
' Format each line of text from the text store and draw it.
Do While textStorePosition < customTextSource.Text.Length
' Create a textline from the text store using the TextFormatter object.
Using myTextLine As TextLine = formatter.FormatLine(customTextSource, textStorePosition, minMaxParaWidth.MinWidth, customTextParagraphProperties, Nothing)
' Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, linePosition, InvertAxes.None)
' Update the index position in the text store.
textStorePosition += myTextLine.Length
' Update the line position coordinate for the displayed line.
linePosition.Y += myTextLine.Height
End Using
Loop
Propriedades
| Name | Description |
|---|---|
| MaxWidth |
Obtém a maior largura de parágrafo possível que consiga conter totalmente o conteúdo de texto especificado. |
| MinWidth |
Obtém a menor largura de parágrafo possível que consiga conter totalmente o conteúdo do texto especificado. |
Métodos
| Name | Description |
|---|---|
| Equals(MinMaxParagraphWidth) |
Determina se o CharacterBufferReference é igual ao objeto atual CharacterBufferReference . |
| Equals(Object) |
Determina se o objeto especificado é igual ao objeto atual CharacterBufferReference . |
| GetHashCode() |
Serve como função de hash para CharacterBufferReference. É adequado para uso em algoritmos de hash e estruturas de dados, como uma tabela de hash. |
Operadores
| Name | Description |
|---|---|
| Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Compare duas CharacterBufferReference cordas para igualdade. |
| Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) |
Compare dois CharacterBufferReference objetos para a desigualdade. |