ID2D1RenderTarget::DrawText methods

Draws the specified text using the format information provided by an IDWriteTextFormat object.

Overload list

MethodDescription
DrawText(WCHAR*,IDWriteTextFormat*,D2D1_RECT_F&,ID2D1Brush*,D2D1_DRAW_TEXT_OPTIONS,DWRITE_TEXT_MEASURING_METHOD)

Draws the specified text using the format information provided by an IDWriteTextFormat object.

DrawText(WCHAR*,IDWriteTextFormat*,D2D1_RECT_F*,ID2D1Brush*,D2D1_DRAW_TEXT_OPTIONS,DWRITE_TEXT_MEASURING_METHOD)

Draws the specified text using the format information provided by an IDWriteTextFormat object.

Remarks

To draw text with Direct2D, use the ID2D1RenderTarget::DrawText method for text that has a single format, or the ID2D1RenderTarget::DrawTextLayout method when you need multiple formats, advanced OpenType features, or hit testing. These methods use the DirectWrite API to provide high-quality text display.

This method doesn't return an error code if it fails. To determine whether a drawing operation (such as DrawText) failed, check the result returned by the ID2D1RenderTarget::EndDraw or ID2D1RenderTarget::Flush methods.

Examples

For an example, see How to Draw Text.

Requirements

Library

D2d1.lib

DLL

D2d1.dll

See also

ID2D1RenderTarget
IDWriteTextFormat
How to Draw Text
Text Formatting and Layout Overview

 

 

Show: