IDWriteTextLayout::SetDrawingEffect method (dwrite.h)

Sets the application-defined drawing effect.

Syntax

HRESULT SetDrawingEffect(
  IUnknown          *drawingEffect,
  DWRITE_TEXT_RANGE textRange
);

Parameters

drawingEffect

Type: IUnknown*

Application-defined drawing effects that apply to the range. This data object will be passed back to the application's drawing callbacks for final rendering.

textRange

Type: DWRITE_TEXT_RANGE

The text range to which this change applies.

Return value

Type: HRESULT

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

Remarks

An ID2D1Brush, such as a color or gradient brush, can be set as a drawing effect if you are using the ID2D1RenderTarget::DrawTextLayout to draw text and that brush will be used to draw the specified range of text.

This drawing effect is associated with the specified range and will be passed back to the application by way of the callback when the range is drawn at drawing time.

Requirements

Requirement Value
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

IDWriteTextLayout