IPicture::SaveAsFile

Saves the picture's data into a stream in the same format that it would save itself into a file. Bitmaps use the BMP file format, metafiles the WMF format, and icons the ICO format. For more information, see the Win32 Programmer's Reference.

HRESULT SaveAsFile(
  IStream * pstream,
                 //Pointer to stream where picture writes its data
  BOOL fSaveMemCopy ,
                 //Indicates whether to save the picture in memory
  LONG* pcbSize  //Receives a pointer to the number of bytes written 
                 //to stream
);
 

Parameters

pstream
[in] Pointer to the stream into which the picture writes its data.
fSaveMemCopy
[in] Flag indicating whether or not to save a copy of the picture in memory.
pcbSize
[out] Pointer to the caller's LONG variable to receive the number of bytes written into the stream. This value can be NULL, indicating that the caller does not require this information.

Return Values

This method supports the standard return values E_FAIL and E_INVALIDARG, as well as the following:

S_OK
The picture was saved successfully.

QuickInfo

  Windows NT: Use version 4.0 or later.
  Windows: Use Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in ocidl.h.