MinMaxParagraphWidth Estructura

Definición

Representa el ancho de párrafo menor y mayor posible que puede incluir íntegramente el contenido de 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)
Herencia
MinMaxParagraphWidth
Implementaciones

Ejemplos

En el ejemplo siguiente se muestra cómo usar la MinWidth propiedad para generar el ancho de párrafo mínimo para las líneas de texto con formato.

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

Propiedades

MaxWidth

Obtiene el ancho de párrafo mayor posible que puede incluir íntegramente el contenido de texto especificado.

MinWidth

Obtiene el ancho de párrafo menor posible que puede incluir íntegramente el contenido de texto especificado.

Métodos

Equals(MinMaxParagraphWidth)

Determina si el objeto CharacterBufferReference es igual al objeto CharacterBufferReference actual.

Equals(Object)

Determina si el objeto especificado es igual al objeto CharacterBufferReference actual.

GetHashCode()

Sirve como función hash de CharacterBufferReference. Es adecuado para usarlo en algoritmos hash y en estructuras de datos, como las tablas hash.

Operadores

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compara dos cadenas CharacterBufferReference para ver si son iguales.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compara dos objetos CharacterBufferReference para determinar si no son iguales.

Se aplica a

Consulte también