MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth Struct

Definizione

Rappresenta la maggiore e la minore larghezza possibili del paragrafo che può contenere il testo completo specificato.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)
Ereditarietà
MinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidth
Implementazioni

Esempi

Nell'esempio seguente viene illustrato come utilizzare la MinWidth proprietà per generare la larghezza minima del paragrafo per le righe di testo formattate.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

Proprietà

MaxWidth MaxWidth MaxWidth MaxWidth

Ottiene la larghezza massima del paragrafo che può includere completamente il contenuto del testo specificato.Gets the largest paragraph width possible that can fully contain the specified text content.

MinWidth MinWidth MinWidth MinWidth

Ottiene la larghezza minima del paragrafo che può includere completamente il contenuto del testo specificato.Gets the smallest paragraph width possible that can fully contain the specified text content.

Metodi

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

Determina se l'oggetto specificato è uguale all'oggetto CharacterBufferReference corrente.Determines whether the specified object is equal to the current CharacterBufferReference object.

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

Consente di determinare se l'oggetto CharacterBufferReference è uguale all'oggetto CharacterBufferReference corrente.Determines whether the CharacterBufferReference is equal to the current CharacterBufferReference object.

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

Usato come funzione hash per CharacterBufferReference.Serves as a hash function for CharacterBufferReference. È adatto per l'utilizzo in algoritmi hash e in strutture dei dati, ad esempio una tabella hash.It is suitable for use in hashing algorithms and data structures such as a hash table.

Operatori

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

Confronta due stringhe CharacterBufferReference per verificarne l'uguaglianza.Compare two CharacterBufferReference strings for equality.

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

Confrontare due oggetti CharacterBufferReference per stabilirne la disuguaglianza.Compare two CharacterBufferReference objects for inequality.

Si applica a

Vedi anche