MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth MinMaxParagraphWidth Struct

Définition

Représente la largeur de paragraphe la plus petite et la plus grande possible pouvant contenir la totalité du contenu textuel spécifié.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)
Héritage
MinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidthMinMaxParagraphWidth
Implémente

Exemples

L’exemple suivant montre comment utiliser la MinWidth propriété pour générer la largeur de paragraphe minimale pour les lignes de texte mises en forme.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

Propriétés

MaxWidth MaxWidth MaxWidth MaxWidth

Obtient la largeur de paragraphe la plus grande possible pouvant contenir la totalité du contenu textuel spécifié.Gets the largest paragraph width possible that can fully contain the specified text content.

MinWidth MinWidth MinWidth MinWidth

Obtient la largeur de paragraphe le plus petite possible pouvant contenir la totalité du contenu textuel spécifié.Gets the smallest paragraph width possible that can fully contain the specified text content.

Méthodes

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

Détermine si l'objet spécifié est identique à l'objet CharacterBufferReference actuel.Determines whether the specified object is equal to the current CharacterBufferReference object.

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

Détermine si le CharacterBufferReference est égal à l'objet CharacterBufferReference actif.Determines whether the CharacterBufferReference is equal to the current CharacterBufferReference object.

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

Sert de fonction de hachage pour CharacterBufferReference.Serves as a hash function for CharacterBufferReference. Cette fonction convient à une utilisation dans des algorithmes de hachage et des structures de données comme une table de hachage.It is suitable for use in hashing algorithms and data structures such as a hash table.

Opérateurs

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

Compare deux chaînes CharacterBufferReference pour vérifier leur égalité.Compare two CharacterBufferReference strings for equality.

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

Compare deux objets CharacterBufferReference pour vérifier leur inégalité.Compare two CharacterBufferReference objects for inequality.

S’applique à

Voir aussi