Export (0) Print
Expand All

ID2D1DeviceContext::CreateBitmap method

Creates a bitmap that can be used as a target surface, for reading back to the CPU, or as a source for the DrawBitmap and ID2D1BitmapBrush APIs. In addition, color context information can be passed to the bitmap.

Syntax


HRESULT CreateBitmap(
  D2D1_SIZE_U size,
  [in, optional]  const void *srcData,
  UINT32 pitch,
  [in]            const D2D1_BITMAP_PROPERTIES1 *bitmapProperties,
  [out]           ID2D1Bitmap1 **bitmap
);

Parameters

size

Type: D2D1_SIZE_U

The pixel size of the bitmap to be created.

srcData [in, optional]

Type: const void*

The initial data that will be loaded into the bitmap.

pitch

Type: UINT32

The pitch of the source data, if specified.

bitmapProperties [in]

Type: const D2D1_BITMAP_PROPERTIES1*

The properties of the bitmap to be created.

bitmap [out]

Type: ID2D1Bitmap1**

When this method returns, contains the address of a pointer to a new bitmap object.

Return value

Type: HRESULT

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

HRESULTDescription
S_OKNo error occurred.
E_OUTOFMEMORYDirect2D could not allocate sufficient memory to complete the call.
E_INVALIDARGAn invalid value was passed to the method.
D3DERR_OUTOFVIDEOMEMORYDirect3D does not have enough display memory to perform the operation.

 

Remarks

The new bitmap can be used as a target for SetTarget if it is created with D2D1_BITMAP_OPTIONS_TARGET.

Requirements

Minimum supported client

Windows 8 and Platform Update for Windows 7 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 and Platform Update for Windows Server 2008 R2 [desktop apps | Windows Store apps]

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Header

D2d1_1.h

DLL

D2d1.dll

See also

ID2D1DeviceContext
D2D1_SIZE_U
D2D1_BITMAP_PROPERTIES1
ID2D1Bitmap1

 

 

Community Additions

ADD
Show:
© 2014 Microsoft