ID2D1RenderTarget::PushAxisAlignedClip(constD2D1_RECT_F*,D2D1_ANTIALIAS_MODE) method (d2d1.h)
Specifies a rectangle to which all subsequent drawing operations are clipped.
Syntax
void PushAxisAlignedClip(
const D2D1_RECT_F *clipRect,
D2D1_ANTIALIAS_MODE antialiasMode
);
Parameters
clipRect
Type: [in] const D2D1_RECT_F*
The size and position of the clipping area, in device-independent pixels.
antialiasMode
Type: [in] D2D1_ANTIALIAS_MODE
The antialiasing mode that is used to draw the edges of clip rects that have subpixel boundaries, and to blend the clip with the scene contents. The blending is performed once when the PopAxisAlignedClip method is called, and does not apply to each primitive within the layer.
Return value
None
Remarks
The clipRect is transformed by the current world transform set on the render target. After the transform is applied to the clipRect that is passed in, the axis-aligned bounding box for the clipRect is computed. For efficiency, the contents are clipped to this axis-aligned bounding box and not to the original clipRect that is passed in.
The following diagrams show how a rotation transform is applied to the render target, the resulting clipRect, and a calculated axis-aligned bounding box.
- Assume the rectangle in the following illustration is a render target that is aligned to the screen pixels.
- Apply a rotation transform to the render target. In the following illustration, the black rectangle represents the original render target and the red dashed rectangle represents the transformed render target.
- After calling PushAxisAlignedClip, the rotation transform is applied to the clipRect. In the following illustration, the blue rectangle represents the transformed clipRect.
- The axis-aligned bounding box is calculated. The green dashed rectangle represents the bounding box in the following illustration. All contents are clipped to this axis-aligned bounding box.
A PushAxisAlignedClip and PopAxisAlignedClip pair can occur around or within a PushLayer and PopLayer, but cannot overlap. For example, the sequence of PushAxisAlignedClip, PushLayer, PopLayer, PopAxisAlignedClip is valid, but the sequence of PushAxisAlignedClip, PushLayer, PopAxisAlignedClip, PopLayer is invalid.
This method doesn't return an error code if it fails. To determine whether a drawing operation (such as PushAxisAlignedClip) failed, check the result returned by the ID2D1RenderTarget::EndDraw or ID2D1RenderTarget::Flush methods.
Requirements
Requirement | Value |
---|---|
Target Platform | Windows |
Header | d2d1.h (include D2d1.h) |
Library | D2d1.lib |
DLL | D2d1.dll |