ID2D1RenderTarget::CreateBitmap(D2D1_SIZE_U,constvoid*,UINT32,constD2D1_BITMAP_PROPERTIES*,ID2D1Bitmap**) method (d2d1.h)

Creates an ID2D1BitmapBrush from the specified bitmap.

Syntax

HRESULT CreateBitmap(
  D2D1_SIZE_U                  size,
  const void                   *srcData,
  UINT32                       pitch,
  const D2D1_BITMAP_PROPERTIES *bitmapProperties,
  ID2D1Bitmap                  **bitmap
);

Parameters

size

Type: [in] D2D1_SIZE_U

The dimensions of the bitmap to create, in pixels.

srcData

Type: [in] const void*

A pointer to the memory location of the image data, or NULL to create an uninitialized bitmap.

pitch

Type: [in] UINT32

The byte count of each scanline, which is equal to (the image width in pixels × the number of bytes per pixel) + memory padding. If srcData is NULL, this value is ignored. (Note that pitch is also sometimes called stride.)

bitmapProperties

Type: [in] const D2D1_BITMAP_PROPERTIES*

The pixel format and dots per inch (DPI) of the bitmap to create.

bitmap

Type: [out] ID2D1Bitmap*

The bitmap contents of the new brush.

Return value

Type: HRESULT

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

Requirements

Requirement Value
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
Library D2d1.lib
DLL D2d1.dll

See also

Brushes Overview

How to Create a Bitmap Brush

ID2D1RenderTarget