CD2DBitmapBrush Class

A wrapper for ID2D1BitmapBrush.

Syntax

class CD2DBitmapBrush : public CD2DBrush;

Members

Public Constructors

Name Description
CD2DBitmapBrush::CD2DBitmapBrush Overloaded. Constructs a CD2DBitmapBrush object from file.
CD2DBitmapBrush::~CD2DBitmapBrush The destructor. Called when a D2D bitmap brush object is being destroyed.

Public Methods

Name Description
CD2DBitmapBrush::Attach Attaches existing resource interface to the object
CD2DBitmapBrush::Create Creates a CD2DBitmapBrush. (Overrides CD2DResource::Create.)
CD2DBitmapBrush::Destroy Destroys a CD2DBitmapBrush object. (Overrides CD2DBrush::Destroy.)
CD2DBitmapBrush::Detach Detaches resource interface from the object
CD2DBitmapBrush::Get Returns ID2D1BitmapBrush interface
CD2DBitmapBrush::GetBitmap Gets the bitmap source that this brush uses to paint
CD2DBitmapBrush::GetExtendModeX Gets the method by which the brush horizontally tiles those areas that extend past its bitmap
CD2DBitmapBrush::GetExtendModeY Gets the method by which the brush vertically tiles those areas that extend past its bitmap
CD2DBitmapBrush::GetInterpolationMode Gets the interpolation method used when the brush bitmap is scaled or rotated
CD2DBitmapBrush::SetBitmap Specifies the bitmap source that this brush uses to paint
CD2DBitmapBrush::SetExtendModeX Specifies how the brush horizontally tiles those areas that extend past its bitmap
CD2DBitmapBrush::SetExtendModeY Specifies how the brush vertically tiles those areas that extend past its bitmap
CD2DBitmapBrush::SetInterpolationMode Specifies the interpolation mode used when the brush bitmap is scaled or rotated

Protected Methods

Name Description
CD2DBitmapBrush::CommonInit Initializes the object

Public Operators

Name Description
CD2DBitmapBrush::operator ID2D1BitmapBrush* Returns ID2D1BitmapBrush interface

Protected Data Members

Name Description
CD2DBitmapBrush::m_pBitmap Stores a pointer to a CD2DBitmap object.
CD2DBitmapBrush::m_pBitmapBrush Stores a pointer to an ID2D1BitmapBrush object.
CD2DBitmapBrush::m_pBitmapBrushProperties Bitmap brush properties.

Inheritance Hierarchy

CObject

CD2DResource

CD2DBrush

CD2DBitmapBrush

Requirements

Header: afxrendertarget.h

CD2DBitmapBrush::~CD2DBitmapBrush

The destructor. Called when a D2D bitmap brush object is being destroyed.

virtual ~CD2DBitmapBrush();

CD2DBitmapBrush::Attach

Attaches existing resource interface to the object

void Attach(ID2D1BitmapBrush* pResource);

Parameters

pResource
Existing resource interface. Cannot be NULL

CD2DBitmapBrush::CD2DBitmapBrush

Constructs a CD2DBitmapBrush object.

CD2DBitmapBrush(
    CRenderTarget* pParentTarget,
    D2D1_BITMAP_BRUSH_PROPERTIES* pBitmapBrushProperties = NULL,
    CD2DBrushProperties* pBrushProperties = NULL,
    BOOL bAutoDestroy = TRUE);

CD2DBitmapBrush(
    CRenderTarget* pParentTarget,
    UINT uiResID,
    LPCTSTR lpszType = NULL,
    CD2DSizeU sizeDest = CD2DSizeU(0, 0),
    D2D1_BITMAP_BRUSH_PROPERTIES* pBitmapBrushProperties = NULL,
    CD2DBrushProperties* pBrushProperties = NULL,
    BOOL bAutoDestroy = TRUE);

CD2DBitmapBrush(
    CRenderTarget* pParentTarget,
    LPCTSTR lpszImagePath,
    CD2DSizeU sizeDest = CD2DSizeU(0, 0),
    D2D1_BITMAP_BRUSH_PROPERTIES* pBitmapBrushProperties = NULL,
    CD2DBrushProperties* pBrushProperties = NULL,
    BOOL bAutoDestroy = TRUE);

Parameters

pParentTarget
A pointer to the render target.

pBitmapBrushProperties
A pointer to the extend modes and the interpolation mode of a bitmap brush.

pBrushProperties
A pointer to the opacity and transformation of a brush.

bAutoDestroy
Indicates that the object will be destroyed by owner (pParentTarget).

uiResID
The resource ID number of the resource.

lpszType
Pointer to a null-terminated string that contains the resource type.

sizeDest
Destination size of the bitmap.

lpszImagePath
Pointer to a null-terminated string that contains the name of file.

CD2DBitmapBrush::CommonInit

Initializes the object

void CommonInit(D2D1_BITMAP_BRUSH_PROPERTIES* pBitmapBrushProperties);

Parameters

pBitmapBrushProperties
A pointer to the bitmap brush properties.

CD2DBitmapBrush::Create

Creates a CD2DBitmapBrush.

virtual HRESULT Create(CRenderTarget* pRenderTarget);

Parameters

pRenderTarget
A pointer to the render target.

Return Value

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

CD2DBitmapBrush::Destroy

Destroys a CD2DBitmapBrush object.

virtual void Destroy();

CD2DBitmapBrush::Detach

Detaches resource interface from the object

ID2D1BitmapBrush* Detach();

Return Value

Pointer to detached resource interface.

CD2DBitmapBrush::Get

Returns ID2D1BitmapBrush interface

ID2D1BitmapBrush* Get();

Return Value

Pointer to an ID2D1BitmapBrush interface or NULL if object is not initialized yet.

CD2DBitmapBrush::GetBitmap

Gets the bitmap source that this brush uses to paint

CD2DBitmap* GetBitmap();

Return Value

Pointer to an CD2DBitmap object or NULL if object is not initialized yet.

CD2DBitmapBrush::GetExtendModeX

Gets the method by which the brush horizontally tiles those areas that extend past its bitmap

D2D1_EXTEND_MODE GetExtendModeX() const;

Return Value

A value that specifies how the brush horizontally tiles those areas that extend past its bitmap

CD2DBitmapBrush::GetExtendModeY

Gets the method by which the brush vertically tiles those areas that extend past its bitmap

D2D1_EXTEND_MODE GetExtendModeY() const;

Return Value

A value that specifies how the brush vertically tiles those areas that extend past its bitmap

CD2DBitmapBrush::GetInterpolationMode

Gets the interpolation method used when the brush bitmap is scaled or rotated

D2D1_BITMAP_INTERPOLATION_MODE GetInterpolationMode() const;

Return Value

The interpolation method used when the brush bitmap is scaled or rotated

CD2DBitmapBrush::m_pBitmap

Stores a pointer to a CD2DBitmap object.

CD2DBitmap* m_pBitmap;

CD2DBitmapBrush::m_pBitmapBrush

Stores a pointer to an ID2D1BitmapBrush object.

ID2D1BitmapBrush* m_pBitmapBrush;

CD2DBitmapBrush::m_pBitmapBrushProperties

Bitmap brush properties.

D2D1_BITMAP_BRUSH_PROPERTIES* m_pBitmapBrushProperties;

CD2DBitmapBrush::operator ID2D1BitmapBrush*

Returns ID2D1BitmapBrush interface

operator ID2D1BitmapBrush*();

Return Value

Pointer to an ID2D1BitmapBrush interface or NULL if object is not initialized yet.

CD2DBitmapBrush::SetBitmap

Specifies the bitmap source that this brush uses to paint

void SetBitmap(CD2DBitmap* pBitmap);

Parameters

pBitmap
The bitmap source used by the brush

CD2DBitmapBrush::SetExtendModeX

Specifies how the brush horizontally tiles those areas that extend past its bitmap

void SetExtendModeX(D2D1_EXTEND_MODE extendModeX);

Parameters

extendModeX
A value that specifies how the brush horizontally tiles those areas that extend past its bitmap

CD2DBitmapBrush::SetExtendModeY

Specifies how the brush vertically tiles those areas that extend past its bitmap

void SetExtendModeY(D2D1_EXTEND_MODE extendModeY);

Parameters

extendModeY
A value that specifies how the brush vertically tiles those areas that extend past its bitmap

CD2DBitmapBrush::SetInterpolationMode

Specifies the interpolation mode used when the brush bitmap is scaled or rotated

void SetInterpolationMode(D2D1_BITMAP_INTERPOLATION_MODE interpolationMode);

Parameters

interpolationMode
The interpolation mode used when the brush bitmap is scaled or rotated

See also

Classes