IDWriteInlineObject::Draw method

The application implemented rendering callback (IDWriteTextRenderer::DrawInlineObject) can use this to draw the inline object without needing to cast or query the object type. The text layout does not call this method directly.

Syntax

HRESULT Draw(
  void                *clientDrawingContext,
  IDWriteTextRenderer *renderer,
  FLOAT               originX,
  FLOAT               originY,
  BOOL                isSideways,
  BOOL                isRightToLeft,
  IUnknown            *clientDrawingEffect
);

Parameters

clientDrawingContext

Type: void*

The drawing context passed to IDWriteTextLayout::Draw. This parameter may be NULL.

renderer

Type: IDWriteTextRenderer*

The same renderer passed to IDWriteTextLayout::Draw as the object's containing parent. This is useful if the inline object is recursive such as a nested layout.

originX

Type: FLOAT

The x-coordinate at the upper-left corner of the inline object.

originY

Type: FLOAT

The y-coordinate at the upper-left corner of the inline object.

isSideways

Type: BOOL

A Boolean flag that indicates whether the object's baseline runs alongside the baseline axis of the line.

isRightToLeft

Type: BOOL

A Boolean flag that indicates whether the object is in a right-to-left context and should be drawn flipped.

clientDrawingEffect

Type: IUnknown*

The drawing effect set in IDWriteTextLayout::SetDrawingEffect. Usually this effect is a foreground brush that is used in glyph drawing.

Return Value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

   
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header dwrite.h
Library Dwrite.lib
DLL Dwrite.dll

See Also

IDWriteInlineObject