WICCreateBitmapFromSection function (wincodec.h)

Returns a IWICBitmapSource that is backed by the pixels of a Windows Graphics Device Interface (GDI) section handle.

Syntax

HRESULT WICCreateBitmapFromSection(
  [in]  UINT                  width,
  [in]  UINT                  height,
        REFWICPixelFormatGUID pixelFormat,
  [in]  HANDLE                hSection,
  [in]  UINT                  stride,
  [in]  UINT                  offset,
  [out] IWICBitmap            **ppIBitmap
);

Parameters

[in] width

Type: UINT

The width of the bitmap pixels.

[in] height

Type: UINT

The height of the bitmap pixels.

pixelFormat

Type: REFWICPixelFormatGUID

The pixel format of the bitmap.

[in] hSection

Type: HANDLE

The section handle. This is a file mapping object handle returned by the CreateFileMapping function.

[in] stride

Type: UINT

The byte count of each scanline.

[in] offset

Type: UINT

The offset into the section.

[out] ppIBitmap

Type: IWICBitmap**

A pointer that receives the bitmap.

Return value

Type: HRESULT

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

Remarks

The WICCreateBitmapFromSection function calls the WICCreateBitmapFromSectionEx function with the desiredAccessLevel parameter set to WICSectionAccessLevelRead.

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