WICCreateBitmapFromSectionEx function (wincodec.h)

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

Syntax

HRESULT WICCreateBitmapFromSectionEx(
  [in]  UINT                  width,
  [in]  UINT                  height,
        REFWICPixelFormatGUID pixelFormat,
  [in]  HANDLE                hSection,
  [in]  UINT                  stride,
  [in]  UINT                  offset,
  [in]  WICSectionAccessLevel desiredAccessLevel,
  [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.

[in] desiredAccessLevel

Type: WICSectionAccessLevel

The desired access level.

[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.

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 wincodec.h
Library Windowscodecs.lib
DLL Windowscodecs.dll