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 | Windows Store apps] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps | Windows Store apps] |
|
Header |
|
|
IDL |
|
|
Library |
|
|
DLL |
|