ID2D1DeviceContext::CreateBitmapBrush(ID2D1Bitmap*,constD2D1_BITMAP_BRUSH_PROPERTIES1&,ID2D1BitmapBrush1**) method (d2d1_1.h)

Creates a bitmap brush, the input image is a Direct2D bitmap object.

Syntax

HRESULT CreateBitmapBrush(
  [in]           ID2D1Bitmap                           *bitmap,
  [in, optional] const D2D1_BITMAP_BRUSH_PROPERTIES1 & bitmapBrushProperties,
  [out]          ID2D1BitmapBrush1                     **bitmapBrush
);

Parameters

[in] bitmap

Type: ID2D1Bitmap*

The bitmap to use as the brush.

[in, optional] bitmapBrushProperties

Type: D2D1_BITMAP_BRUSH_PROPERTIES1*

A bitmap brush properties structure.

[out] bitmapBrush

Type: ID2D1BitmapBrush1**

The address of the newly created bitmap brush object.

Return value

Type: HRESULT

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

HRESULT Description
S_OK No error occurred.
E_OUTOFMEMORY Direct2D could not allocate sufficient memory to complete the call.
E_INVALIDARG An invalid parameter was passed to the returning function.

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

D2D1_BITMAP_BRUSH_PROPERTIES1

D2D1_BRUSH_PROPERTIES

ID2D1Bitmap

ID2D1BitmapBrush1

ID2D1DeviceContext