共用方式為


MinMaxParagraphWidth 結構

定義

代表可完整內含指定之文字內容的最小及最大可能段落的寬度。

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 屬性來產生格式化文字行的最小段落寬度。

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

取得可以完整容納所指定文字內容的最大段落寬度。

MinWidth

取得可以完整容納所指定文字內容的最小段落寬度。

方法

Equals(MinMaxParagraphWidth)

判斷 CharacterBufferReference 是否等於目前的 CharacterBufferReference 物件。

Equals(Object)

判斷指定的物件是否等於目前的 CharacterBufferReference 物件。

GetHashCode()

作為 CharacterBufferReference 的雜湊函式。 它適用於雜湊演算法和資料結構,例如雜湊資料表。

運算子

Equality(MinMaxParagraphWidth, MinMaxParagraphWidth)

比較兩個 CharacterBufferReference 字串是否相等。

Inequality(MinMaxParagraphWidth, MinMaxParagraphWidth)

比較兩個 CharacterBufferReference 物件是否不相等。

適用於

另請參閱