IWICBitmapFrameEncode::WriteSource method (wincodec.h)
Encodes a bitmap source.
HRESULT WriteSource( IWICBitmapSource *pIBitmapSource, WICRect *prc );
The bitmap source to encode.
The size rectangle of the bitmap source.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
If SetResolution is not called prior to calling WriteSource, the pixel format of pIBitmapSource is used.
If SetPalette is not called prior to calling WriteSource, the target pixel format is indexed, and the pixel format of pIBitmapSource matches the encoder frame's pixel format, then the pIBitmapSource pixel format is used.
When encoding a GIF image, if the global palette is set and the frame level palette is not set directly by the user or by a custom independent software vendor (ISV) GIF codec, WriteSource will use the global palette to encode the frame even when pIBitmapSource has a frame level palette.
Starting with Windows Vista, repeated WriteSource calls can be made as long as the total accumulated source rect height is the same as set through SetSize.
Starting with Windows 8.1, the source rect must be at least the dimensions set through SetSize. If the source rect width exceeds the SetSize width, extra pixels on the right side are ignored. If the source rect height exceeds the remaining unfilled height, extra scan lines on the bottom are ignored.
|Minimum supported client||Windows XP with SP2, Windows Vista [desktop apps | UWP apps]|
|Minimum supported server||Windows Server 2008 [desktop apps | UWP apps]|