다음을 통해 공유


TextFormatter.FormatMinMaxParagraphWidth 메서드

정의

지정한 텍스트 내용을 완전히 포함할 수 있는 가능한 가장 작고 가장 큰 단락 너비를 나타내는 값을 반환합니다.

오버로드

Name Description
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 지정한 텍스트 내용을 완전히 포함할 수 있는 가능한 가장 작고 가장 큰 단락 너비를 나타내는 값입니다.

예제

다음 예제에서는 서식이 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 지정한 텍스트 내용을 완전히 포함할 수 있는 가능한 가장 작고 가장 큰 단락 너비를 나타내는 값입니다.

적용 대상