Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

IWICImagingFactory::CreateBitmapFromSourceRect method

Creates an IWICBitmap from a specified rectangle of an IWICBitmapSource.

Syntax


HRESULT CreateBitmapFromSourceRect(
  [in]  IWICBitmapSource *pIBitmapSource,
  [in]  UINT             x,
  [in]  UINT             y,
  [in]  UINT             width,
  [in]  UINT             height,
  [out] IWICBitmap       **ppIBitmap
);

Parameters

pIBitmapSource [in]

Type: IWICBitmapSource*

The IWICBitmapSource to create the bitmap from.

x [in]

Type: UINT

The horizontal coordinate of the upper-left corner of the rectangle.

y [in]

Type: UINT

The vertical coordinate of the upper-left corner of the rectangle.

width [in]

Type: UINT

The width of the rectangle and the new bitmap.

height [in]

Type: UINT

The height of the rectangle and the new 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

Providing a rectangle that is larger than the source will produce undefined results.

This method always creates a separate copy of the source image, similar to the cache option WICBitmapCacheOnLoad.

Requirements

Minimum supported client

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

Minimum supported server

Windows Server 2008 [desktop apps | UWP apps]

Header

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

 

 

Show:
© 2017 Microsoft