IWICImagingFactory::CreateBitmap method (wincodec.h)

Creates an IWICBitmap object.

Syntax

HRESULT CreateBitmap(
  [in]  UINT                       uiWidth,
  [in]  UINT                       uiHeight,
  [in]  REFWICPixelFormatGUID      pixelFormat,
  [in]  WICBitmapCreateCacheOption option,
  [out] IWICBitmap                 **ppIBitmap
);

Parameters

[in] uiWidth

Type: UINT

The width of the new bitmap .

[in] uiHeight

Type: UINT

The height of the new bitmap.

[in] pixelFormat

Type: REFWICPixelFormatGUID

The pixel format of the new bitmap.

[in] option

Type: WICBitmapCreateCacheOption

The cache creation options of the new bitmap. This can be one of the values in the WICBitmapCreateCacheOption enumeration.

Value Meaning
WICBitmapCacheOnDemand
Allocates system memory for the bitmap at initialization.
WICBitmapCacheOnLoad
Allocates system memory for the bitmap when the bitmap is first used.
WICBitmapNoCache
This option is not valid for this method and should not be used.

[out] ppIBitmap

Type: IWICBitmap**

A pointer that receives a pointer to the new bitmap.

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 XP with SP2, Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header wincodec.h
Library Windowscodecs.lib
DLL Windowscodecs.dll

See also

IWICImagingFactory

Native Pixel Formats