Returns a drawing surface of the requested size and format.
HRESULT GetSurface( LONG nWidth, LONG nHeight, REFGUID bfid, ULONG nPasses, DWORD dwHints, IUnknown **ppSurface );
- [in] A long integer that specifies width in pixels.
- [in] A long integer that specifies height in pixels.
- [in] A GUID that specifies the destination format. See IImageDecodeEventSink::OnBeginDecode for a list of supported formats.
- [in] An unsigned long integer that specifies the number of passes required by interlacing image formats.
- [in] Any combination of the following flags.
- The image is drawn from top to bottom.
- (Unused) The image is drawn from bottom to top.
- The image initially is drawn at full width, instead of by quadrants.
- [out] A pointer to a variable of type IUnknown that receives an object that implements the drawing surface.
Returns S_OK if successful, or an error value otherwise.
The nPasses and dwHints parameter values are optional, and can be ignored by the event sink. Multi-pass decoding is possible even if the nPasses parameter is set to 1. Some event sinks dither RGB-8 images on consecutive calls to IImageDecodeEventSink::OnProgress, if
IMGDECODE_HINT_FULLWIDTHare passed in dwHints.
IMGDECODE_EVENT_USEDDRAWis returned by IImageDecodeEventSink::OnBeginDecode in the pdwEvents parameter, then the object returned in the ppSurface parameter provides minimal support for the IDirectDrawSurface interface. You must call Release on the pointer after querying it for the IDirectDrawSurface interface to subtract the additional reference count.
The following seven methods are supported by the drawing surface.