MinMaxParagraphWidth Struktura

Definicja

Reprezentuje najmniejszą i największą możliwą szerokość akapitu, która może w pełni zawierać określoną zawartość tekstowa.

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)
Dziedziczenie
MinMaxParagraphWidth
Implementuje

Przykłady

W poniższym przykładzie pokazano, jak za pomocą MinWidth właściwości wygenerować minimalną szerokość akapitu dla sformatowanych wierszy tekstu.

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

Właściwości

MaxWidth

Pobiera największą możliwą szerokość akapitu, która może w pełni zawierać określoną zawartość tekstowa.

MinWidth

Pobiera najmniejszą szerokość akapitu, która może w pełni zawierać określoną zawartość tekstowa.

Metody

Equals(MinMaxParagraphWidth)

Określa, czy obiekt CharacterBufferReference jest równy bieżącemu CharacterBufferReference obiektowi.

Equals(Object)

Określa, czy określony obiekt jest równy bieżącemu CharacterBufferReference obiektowi.

GetHashCode()

Służy jako funkcja skrótu dla CharacterBufferReferenceelementu . Nadaje się do użycia w algorytmach tworzenia skrótów i strukturach danych, takich jak tabela skrótów.

Operatory

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Porównaj dwa CharacterBufferReference ciągi pod kątem równości.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Porównaj dwa CharacterBufferReference obiekty pod kątem nierówności.

Dotyczy

Zobacz też