TextFormatter.FormatMinMaxParagraphWidth 메서드

정의

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 값을 반환합니다.

오버로드

FormatMinMaxParagraphWidth(TextSource, Int32, TextParagraphProperties)

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 값을 반환합니다.

FormatMinMaxParagraphWidth(TextSource, Int32, TextParagraphProperties, TextRunCache)

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 값을 반환합니다.

FormatMinMaxParagraphWidth(TextSource, Int32, TextParagraphProperties)

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 값을 반환합니다.

public:
 abstract System::Windows::Media::TextFormatting::MinMaxParagraphWidth FormatMinMaxParagraphWidth(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties);
public abstract System.Windows.Media.TextFormatting.MinMaxParagraphWidth FormatMinMaxParagraphWidth (System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties);
abstract member FormatMinMaxParagraphWidth : System.Windows.Media.TextFormatting.TextSource * int * System.Windows.Media.TextFormatting.TextParagraphProperties -> System.Windows.Media.TextFormatting.MinMaxParagraphWidth
Public MustOverride Function FormatMinMaxParagraphWidth (textSource As TextSource, firstCharIndex As Integer, paragraphProperties As TextParagraphProperties) As MinMaxParagraphWidth

매개 변수

textSource
TextSource

줄의 텍스트 소스를 나타내는 TextSource 개체입니다.

firstCharIndex
Int32

줄에서 시작 문자의 문자 인덱스를 지정하는 Int32 값입니다.

paragraphProperties
TextParagraphProperties

흐름 방향, 맞춤, 들여쓰기 등의 단락 속성을 나타내는 TextParagraphProperties 개체입니다.

반환

MinMaxParagraphWidth

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 MinMaxParagraphWidth 값입니다.

예제

다음 예제에서는 서식 있는 텍스트 줄에 FormatMinMaxParagraphWidth 대 한 최소 단락 너비를 생성 하는 메서드를 사용 하는 방법을 보여 있습니다.

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

설명

다음 텍스트는 원본 텍스트에 대해 최소 단락 너비를 사용합니다. 이 너비는 여러 줄로 표시됩니다. 최소 단락 너비는 너비가 가장 큰 단어(이 경우 "jumped")에 해당합니다. 총 너비가 최소 단락 너비를 초과하지 않는 한 여러 단어가 같은 줄에 나타날 수 있습니다.

최소 단락 너비를 사용하는 텍스트 포맷터
최소 단락 너비

적용 대상

FormatMinMaxParagraphWidth(TextSource, Int32, TextParagraphProperties, TextRunCache)

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 값을 반환합니다.

public:
 abstract System::Windows::Media::TextFormatting::MinMaxParagraphWidth FormatMinMaxParagraphWidth(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties, System::Windows::Media::TextFormatting::TextRunCache ^ textRunCache);
public abstract System.Windows.Media.TextFormatting.MinMaxParagraphWidth FormatMinMaxParagraphWidth (System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties, System.Windows.Media.TextFormatting.TextRunCache textRunCache);
abstract member FormatMinMaxParagraphWidth : System.Windows.Media.TextFormatting.TextSource * int * System.Windows.Media.TextFormatting.TextParagraphProperties * System.Windows.Media.TextFormatting.TextRunCache -> System.Windows.Media.TextFormatting.MinMaxParagraphWidth
Public MustOverride Function FormatMinMaxParagraphWidth (textSource As TextSource, firstCharIndex As Integer, paragraphProperties As TextParagraphProperties, textRunCache As TextRunCache) As MinMaxParagraphWidth

매개 변수

textSource
TextSource

줄의 텍스트 소스를 나타내는 TextSource 개체입니다.

firstCharIndex
Int32

줄에서 시작 문자의 문자 인덱스를 지정하는 Int32 값입니다.

paragraphProperties
TextParagraphProperties

흐름 방향, 맞춤, 들여쓰기 등의 단락 속성을 나타내는 TextParagraphProperties 개체입니다.

textRunCache
TextRunCache

텍스트 레이아웃의 캐싱 메커니즘을 나타내는 TextRunCache 개체입니다.

반환

MinMaxParagraphWidth

지정된 텍스트 내용 전체를 포함할 수 있는 최소 및 최대 단락 너비를 나타내는 MinMaxParagraphWidth 값입니다.

적용 대상