Bagikan melalui


MinMaxParagraphWidth Struktur

Definisi

Mewakili lebar paragraf terkecil dan terbesar yang dapat sepenuhnya berisi konten teks yang ditentukan.

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)
Warisan
MinMaxParagraphWidth
Penerapan

Contoh

Contoh berikut menunjukkan cara menggunakan MinWidth properti untuk menghasilkan lebar paragraf minimum untuk baris teks yang diformat.

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

Properti

Nama Deskripsi
MaxWidth

Mendapatkan lebar paragraf terbesar yang mungkin dapat sepenuhnya berisi konten teks yang ditentukan.

MinWidth

Mendapatkan lebar paragraf terkecil yang dapat sepenuhnya berisi konten teks yang ditentukan.

Metode

Nama Deskripsi
Equals(MinMaxParagraphWidth)

Menentukan apakah CharacterBufferReference sama dengan objek saat ini CharacterBufferReference .

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini CharacterBufferReference .

GetHashCode()

Berfungsi sebagai fungsi hash untuk CharacterBufferReference. Ini cocok untuk digunakan dalam algoritma hashing dan struktur data seperti tabel hash.

Operator

Nama Deskripsi
Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Bandingkan dua CharacterBufferReference string untuk kesetaraan.

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

Bandingkan dua CharacterBufferReference objek untuk ketidaksamaan.

Berlaku untuk

Lihat juga