csharp System.Windows.Media.TextFormatting.MinMaxParagraphWidth类(方法)实例源码

下面列出了csharp System.Windows.Media.TextFormatting.MinMaxParagraphWidth 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Windows.Media.TextFormattin   
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;
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号