MinMaxParagraphWidth Структура

Определение

Represents the smallest and largest possible paragraph width that can fully contain the specified text content.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)
Наследование
MinMaxParagraphWidth
Реализации

Примеры

В следующем примере показано, как использовать свойство MinWidth для создания минимальной ширины абзаца для форматированных строк текста.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

Свойства

MaxWidth

Gets the largest paragraph width possible that can fully contain the specified text content.Gets the largest paragraph width possible that can fully contain the specified text content.

MinWidth

Gets the smallest paragraph width possible that can fully contain the specified text content.Gets the smallest paragraph width possible that can fully contain the specified text content.

Методы

Equals(MinMaxParagraphWidth)

Determines whether the CharacterBufferReference is equal to the current CharacterBufferReference object.Determines whether the CharacterBufferReference is equal to the current CharacterBufferReference object.

Equals(Object)

Determines whether the specified object is equal to the current CharacterBufferReference object.Determines whether the specified object is equal to the current CharacterBufferReference object.

GetHashCode()

Serves as a hash function for CharacterBufferReference.Serves as a hash function for CharacterBufferReference. It is suitable for use in hashing algorithms and data structures such as a hash table.It is suitable for use in hashing algorithms and data structures such as a hash table.

Операторы

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compare two CharacterBufferReference strings for equality.Compare two CharacterBufferReference strings for equality.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Compare two CharacterBufferReference objects for inequality.Compare two CharacterBufferReference objects for inequality.

Применяется к

Дополнительно