ID2D1ImageBrush::SetSourceRectangle method (d2d1_1.h)

Sets the source rectangle in the image brush.

Syntax

void SetSourceRectangle(
  [in] const D2D1_RECT_F *sourceRectangle
);

Parameters

[in] sourceRectangle

Type: const D2D1_RECT_F*

The source rectangle that defines the portion of the image to tile.

Return value

None

Remarks

The top left corner of the sourceRectangle parameter maps to the brush space origin. That is, if the brush and world transforms are both identity, the portion of the image in the top left corner of the source rectangle will be rendered at (0,0) in the render target.

The source rectangle will be expanded differently depending on whether the input image is based on pixels (a bitmap or effect) or by a command list.

  • If the input image is a bitmap or an effect, the rectangle will be expanded to encapsulate a full input pixel before being additionally down-scaled to ensure that the projected rectangle will be correct in the final scene-space.
  • If the input image is a command list, the command list will be slightly expanded to encapsulate a full input pixel.

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 d2d1_1.h
DLL D2d1.dll

See also

ID2D1ImageBrush