Språk

TextFormatter.FormatLine Metod

Definition

Skapar en TextLine som används för att formatera och visa dokumentinnehåll.

Överlagringar

Name Description
FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)

Skapar en TextLine som används för att formatera och visa dokumentinnehåll.

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache)

Skapar en TextLine som används för att formatera och visa dokumentinnehåll.

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak)

Skapar en TextLine som används för att formatera och visa dokumentinnehåll.

public:
 abstract System::Windows::Media::TextFormatting::TextLine ^ FormatLine(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, double paragraphWidth, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties, System::Windows::Media::TextFormatting::TextLineBreak ^ previousLineBreak);
public abstract System.Windows.Media.TextFormatting.TextLine FormatLine(System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, double paragraphWidth, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties, System.Windows.Media.TextFormatting.TextLineBreak previousLineBreak);
abstract member FormatLine : System.Windows.Media.TextFormatting.TextSource * int * double * System.Windows.Media.TextFormatting.TextParagraphProperties * System.Windows.Media.TextFormatting.TextLineBreak -> System.Windows.Media.TextFormatting.TextLine
Public MustOverride Function FormatLine (textSource As TextSource, firstCharIndex As Integer, paragraphWidth As Double, paragraphProperties As TextParagraphProperties, previousLineBreak As TextLineBreak) As TextLine

Parametrar

textSource
TextSource

Ett TextSource värde som representerar textkällan för raden.

firstCharIndex
Int32

Ett Int32 värde som anger teckenindexet för starttecknet på raden.

paragraphWidth
Double

Ett Double värde som anger bredden på det stycke som raden fyller.

paragraphProperties
TextParagraphProperties

Ett TextParagraphProperties värde som representerar styckeegenskaper, till exempel flödesriktning, justering eller indrag.

previousLineBreak
TextLineBreak

Ett TextLineBreak värde som anger textformateringstillståndet, när det gäller var den föregående raden i stycket bröts av textformateringsprocessen.

Returer

Ett TextLine värde som representerar en textrad som kan visas.

Exempel

I följande exempel visas hur du använder FormatLine metoden för att returnera en formaterad TextLine.

// Create a textline from the text store using the TextFormatter object.
TextLine myTextLine = formatter.FormatLine(
    customTextSource,
    0,
    400,
    customTextParagraphProperties,
    null);

// Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, new Point(0, 0), InvertAxes.None);
' Create a textline from the text store using the TextFormatter object.
Dim myTextLine As TextLine = formatter.FormatLine(customTextSource, 0, 400, customTextParagraphProperties, Nothing)

' Draw the formatted text into the drawing context.
myTextLine.Draw(drawingContext, New Point(0, 0), InvertAxes.None)

Gäller för

FormatLine(TextSource, Int32, Double, TextParagraphProperties, TextLineBreak, TextRunCache)

Skapar en TextLine som används för att formatera och visa dokumentinnehåll.

public:
 abstract System::Windows::Media::TextFormatting::TextLine ^ FormatLine(System::Windows::Media::TextFormatting::TextSource ^ textSource, int firstCharIndex, double paragraphWidth, System::Windows::Media::TextFormatting::TextParagraphProperties ^ paragraphProperties, System::Windows::Media::TextFormatting::TextLineBreak ^ previousLineBreak, System::Windows::Media::TextFormatting::TextRunCache ^ textRunCache);
public abstract System.Windows.Media.TextFormatting.TextLine FormatLine(System.Windows.Media.TextFormatting.TextSource textSource, int firstCharIndex, double paragraphWidth, System.Windows.Media.TextFormatting.TextParagraphProperties paragraphProperties, System.Windows.Media.TextFormatting.TextLineBreak previousLineBreak, System.Windows.Media.TextFormatting.TextRunCache textRunCache);
abstract member FormatLine : System.Windows.Media.TextFormatting.TextSource * int * double * System.Windows.Media.TextFormatting.TextParagraphProperties * System.Windows.Media.TextFormatting.TextLineBreak * System.Windows.Media.TextFormatting.TextRunCache -> System.Windows.Media.TextFormatting.TextLine
Public MustOverride Function FormatLine (textSource As TextSource, firstCharIndex As Integer, paragraphWidth As Double, paragraphProperties As TextParagraphProperties, previousLineBreak As TextLineBreak, textRunCache As TextRunCache) As TextLine

Parametrar

textSource
TextSource

Ett TextSource objekt som representerar textkällan för raden.

firstCharIndex
Int32

Ett Int32 värde som anger teckenindexet för starttecknet på raden.

paragraphWidth
Double

Ett Double värde som anger bredden på det stycke som raden fyller.

paragraphProperties
TextParagraphProperties

Ett TextParagraphProperties objekt som representerar styckeegenskaper, till exempel flödesriktning, justering eller indrag.

previousLineBreak
TextLineBreak

Ett TextLineBreak objekt som anger textformateringstillståndet, när det gäller var den föregående raden i stycket bröts av textformateringsprocessen.

textRunCache
TextRunCache

Ett TextRunCache objekt som representerar cachelagringsmekanismen för textlayouten.

Returer

Ett TextLine värde som representerar en textrad som kan visas.

Kommentarer

Den här metoden används för att förbättra prestanda i program där det TextLine har betydande prestandakonsekvenser.

Gäller för