Skip to content

Latest commit

 

History

History
71 lines (43 loc) · 3.91 KB

id2d1rendertarget-drawtext.md

File metadata and controls

71 lines (43 loc) · 3.91 KB
title description ms.assetid keywords topic_type api_location api_type ms.topic ms.date api_name
ID2D1RenderTarget DrawText methods
Draws the specified text using the format information provided by an IDWriteTextFormat object.
7cda7854-f9df-48d3-bc62-6aaee769e6f9
DrawText methods Direct2D
apiref
D2d1.dll
DllExport
reference
05/31/2018

ID2D1RenderTarget::DrawText methods

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

Overload list

Method Description
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

Requirement Value
Library
D2d1.lib
DLL
D2d1.dll

See also

ID2D1RenderTarget

IDWriteTextFormat

How to Draw Text

Text Formatting and Layout Overview