Export (0) Print
Expand All

IWICImagingFactory::CreateBitmapFromMemory method

Creates an IWICBitmap from a memory block.

Syntax


HRESULT CreateBitmapFromMemory(
  [in]   UINT uiWidth,
  [in]   UINT uiHeight,
  [in]   REFWICPixelFormatGUID pixelFormat,
  [in]   UINT cbStride,
  [in]   UINT cbBufferSize,
  [in]   BYTE *pbBuffer,
  [out]  IWICBitmap **ppIBitmap
);

Parameters

uiWidth [in]

Type: UINT

The width of the new bitmap.

uiHeight [in]

Type: UINT

The height of the new bitmap.

pixelFormat [in]

Type: REFWICPixelFormatGUID

The pixel format of the new bitmap. For valid pixel formats, see Native Pixel Formats.

cbStride [in]

Type: UINT

The number of bytes between successive scanlines in pbBuffer.

cbBufferSize [in]

Type: UINT

The size of pbBuffer.

pbBuffer [in]

Type: BYTE*

The buffer used to create the bitmap.

ppIBitmap [out]

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.

Remarks

The size of the IWICBitmap to be created must be smaller than or equal to the size of the image in pbBuffer.

The stride of the destination bitmap will equal the stride of the source data, regardless of the width and height specified.

The pixelFormat parameter defines the pixel format for both the input data and the output bitmap.

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2008 [desktop apps | Windows Store apps]

Header

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft