ID2D1SourceTransform::Draw method (d2d1effectauthor.h)

Draws the transform to the graphics processing unit (GPU)–based Direct2D pipeline.

Syntax

HRESULT Draw(
  [in] ID2D1Bitmap1      *target,
  [in] const D2D1_RECT_L *drawRect,
       D2D1_POINT_2U     targetOrigin
);

Parameters

[in] target

Type: ID2D1Bitmap1*

The target to which the transform should be written.

[in] drawRect

Type: const D2D1_RECT_L*

The area within the source from which the image should be drawn.

targetOrigin

Type: D2D1_POINT_2U

The origin within the target bitmap to which the source data should be drawn.

Return value

Type: HRESULT

If the method succeeds, it returns S_OK. If it fails, it returns an HRESULT error code.

Remarks

The implementation of the rasterizer guarantees that adding the renderRect to the targetOrigin does not exceed the bounds of the bitmap.

When implementing this method you must update the bitmap in this way:

  1. Call the ID2D1Bitmap::Map method with the D2D1_MAP_OPTIONS_DISCARD and D2D1_MAP_OPTIONS_WRITE flags.
  2. Update the buffer this method returns.
  3. Call the ID2D1Bitmap::Unmap method.
If you set the buffer precision manually on the associated ID2D1RenderInfo object, it must handle different pixel formats in this method by calling ID2D1Bitmap::GetPixelFormat. If you set the buffer precision manually, then you can rely on that format always being the one you provided.

Requirements

Requirement Value
Minimum supported client Windows 8 and Platform Update for Windows 7 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | UWP apps]
Target Platform Windows
Header d2d1effectauthor.h
Library D2d1.lib

See also

ID2D1EffectImpl

ID2D1SourceTransform