ID2D1Brush interface

Defines an object that paints an area. Interfaces that derive from ID2D1Brush describe how the area is painted.

Methods

The ID2D1Brush interface has these methods.

Method Description
ID2D1Brush::GetOpacity Gets the degree of opacity of this brush.
ID2D1Brush::GetTransform Gets the transform applied to this brush.
ID2D1Brush::SetOpacity Sets the degree of opacity of this brush.
ID2D1Brush::SetTransform Sets the transformation applied to the brush.
ID2D1Brush::SetTransform Sets the transformation applied to the brush.

Remarks

An ID2D1BitmapBrush is a device-dependent resource: your application should create bitmap brushes after it initializes the render target with which the bitmap brush will be used, and recreate the bitmap brush whenever the render target needs recreated. (For more information about resources, see Resources Overview.)

Brush space in Direct2D is specified differently than in XPS and Windows Presentation Foundation (WPF). In Direct2D, brush space is not relative to the object being drawn, but rather is the current coordinate system of the render target, transformed by the brush transform, if present. To paint an object as it would be painted by a WPF brush, you must translate the brush space origin to the upper-left corner of the object's bounding box, and then scale the brush space so that the base tile fills the bounding box of the object.

For more information about brushes, see the Brushes Overview.

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 d2d1.h

See Also

Brushes Overview

ID2D1Resource