EN
Il contenuto non è disponibile nella lingua di destinazione, ma solo in inglese.

IWICBitmapFrameEncode::WriteSource method

Encodes a bitmap source.

Syntax


HRESULT WriteSource(
  [in]          IWICBitmapSource *pIBitmapSource,
  [in, unique]  WICRect *prc
);

Parameters

pIBitmapSource [in]

Type: IWICBitmapSource*

The bitmap source to encode.

prc [in]

Type: WICRect*

The size rectangle of the bitmap source.

Return value

Type: HRESULT

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

Remarks

If SetSize is not called prior to calling WriteSource, the size given in prc is used if not NULL. Otherwise, the size of the IWICBitmapSource given in pIBitmapSource is used.

If SetPixelFormat is not called prior to calling WriteSource, the pixel format of the IWICBitmapSource given in pIBitmapSource is used.

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.

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

Wincodec.h

IDL

Wincodec.idl

Library

Windowscodecs.lib

DLL

Windowscodecs.dll

See also

IWICBitmapFrameEncode
Conceptual
Windows Imaging Component Overview
How to Write a WIC-Enabled CODEC

 

 

Aggiunte alla community

AGGIUNGI
Mostra:
© 2014 Microsoft