[]
        
(Showing Draft Content)

C1.Util.DX.Direct2D.RenderTarget.DrawText

DrawText Method

DrawText(string, TextFormat, RectF, Brush)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

Declaration
public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush)
Parameters
Type Name Description
string text

A reference to an array of Unicode characters to draw.

TextFormat textFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

RectF layoutRect

The size and position of the area in which the text is drawn.

Brush defaultForegroundBrush

The brush used to paint the text.

DrawText(string, TextFormat, RectF, Brush, DrawTextOptions)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

Declaration
public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options)
Parameters
Type Name Description
string text

A reference to an array of Unicode characters to draw.

TextFormat textFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

RectF layoutRect

The size and position of the area in which the text is drawn.

Brush defaultForegroundBrush

The brush used to paint the text.

DrawTextOptions options

A value that indicates whether the text should be snapped to pixel boundaries and whether the text should be clipped to the layout rectangle. The default value is C1.Win.DX.Direct2D.DrawTextOptions.None, which indicates that text should be snapped to pixel boundaries and it should not be clipped to the layout rectangle.

DrawText(string, TextFormat, RectF, Brush, DrawTextOptions, MeasuringMode)

Draws the specified text using the format information provided by an C1.Win.DX.DirectWrite.TextFormat object.

Declaration
public void DrawText(string text, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options, MeasuringMode measuringMode)
Parameters
Type Name Description
string text

A reference to an array of Unicode characters to draw.

TextFormat textFormat

An object that describes formatting details of the text to draw, such as the font, the font size, and flow direction.

RectF layoutRect

The size and position of the area in which the text is drawn.

Brush defaultForegroundBrush

The brush used to paint the text.

DrawTextOptions options

A value that indicates whether the text should be snapped to pixel boundaries and whether the text should be clipped to the layout rectangle. The default value is C1.Win.DX.Direct2D.DrawTextOptions.None, which indicates that text should be snapped to pixel boundaries and it should not be clipped to the layout rectangle.

MeasuringMode measuringMode

A value that indicates how glyph metrics are used to measure text when it is formatted. The default value is DWRITE_MEASURING_MODE_NATURAL.

DrawText(string, int, TextFormat, RectF, Brush, DrawTextOptions, MeasuringMode)

void ID2D1RenderTarget::DrawText([In, Buffer] const wchar_t* string,[In] unsigned int stringLength,[In] IDWriteTextFormat* textFormat,[In] const D2D_RECT_F* layoutRect,[In] ID2D1Brush* defaultForegroundBrush,[In] D2D1_DRAW_TEXT_OPTIONS options,[In] DWRITE_MEASURING_MODE measuringMode)

Declaration
public void DrawText(string text, int stringLength, TextFormat textFormat, RectF layoutRect, Brush defaultForegroundBrush, DrawTextOptions options = DrawTextOptions.None, MeasuringMode measuringMode = MeasuringMode.Natural)
Parameters
Type Name Description
string text
int stringLength
TextFormat textFormat
RectF layoutRect
Brush defaultForegroundBrush
DrawTextOptions options
MeasuringMode measuringMode