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 对象是否不相等。

适用于

另请参阅