MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth Struct

Definição

Representa a menor e a maior larguras de parágrafo possíveis que contêm totalmente o conteúdo de texto especificado.Represents the smallest and largest possible paragraph width that can fully contain the specified text content.

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
MinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidth
Implementações

Exemplos

O exemplo a seguir mostra como usar a MinWidth propriedade para gerar a largura mínima do parágrafo para as linhas de texto formatadas.The following example shows how to use the MinWidth property to generate the minimum paragraph width for the formatted lines of text.

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

MaxWidth MaxWidth MaxWidth MaxWidth

Obtém a maior largura de parágrafo possível que pode conter completamente o conteúdo do texto especificado.Gets the largest paragraph width possible that can fully contain the specified text content.

MinWidth MinWidth MinWidth MinWidth

Obtém a menor largura de parágrafo possível que pode conter completamente o conteúdo do texto especificado.Gets the smallest paragraph width possible that can fully contain the specified text content.

Métodos

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determina se o objeto especificado é igual ao objeto CharacterBufferReference atual.Determines whether the specified object is equal to the current CharacterBufferReference object.

Equals(MinMaxParagraphWidth) Equals(MinMaxParagraphWidth) Equals(MinMaxParagraphWidth) Equals(MinMaxParagraphWidth)

Determina se o CharacterBufferReference é igual ao objeto CharacterBufferReference atual.Determines whether the CharacterBufferReference is equal to the current CharacterBufferReference object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serve como uma função de hash para CharacterBufferReference.Serves as a hash function for CharacterBufferReference. Ele é adequado para uso em algoritmos de hash e estruturas de dados como uma tabela de hash.It is suitable for use in hashing algorithms and data structures such as a hash table.

Operadores

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) Equality(MinMaxParagraphWidth, MinMaxParagraphWidth) Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compare duas cadeias de caracteres de CharacterBufferReference quanto à igualdade.Compare two CharacterBufferReference strings for equality.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth) Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compare dois objetos CharacterBufferReference quanto à desigualdade.Compare two CharacterBufferReference objects for inequality.

Aplica-se a

Veja também