saveToFileJPEG Method

This function saves the contents of an image buffer to a JPEG file.
Syntax:
Error saveToFileJPEG( const IFrame& buf, const std::string& filename, int quality = 75 );
Error saveToFileJPEG( const IFrame& buf, const std::wstring& filename, int quality = 75 );
Error saveToFileJPEG( const IFrame& buf, const wchar_t* pFilename, int quality = 75 );
Parameter Description
buf

The buffer that is to be saved.

filename

Specifies the filename of the JPEG file.

pFilename

Specifies the filename of the JPEG file.

quality

Specifies the quality of the JPEG file. This value must be within the range [0,100], with 100 being the highest quality.

Return value:

This method returns an error object. If successful, it is set to eNOERROR. If the conversion fails, eINVALID_PARAM_VAL is returned.

Remarks:

This method saves the contents of the passed IFrame into a JPEG file with the given quality. The contents of the IFrame are internally converted into JPEG format. This conversion may take a while.

Information:

Introduced in IC Imaging Control 2.0

Sample:

The following sample shows how to snap an image and save it to a JPEG file.

if( m_Grabber.isLive())
{
    if( m_Grabber.snapImages())
    {
        DShowLib::saveToFileJPEG(*m_Grabber.getActiveMemBuffer(),"Testimage.jpg",90);
    }
}
See also: IFrame, saveToFileBMP

<< Class Library Reference

This site is part of The Imaging Source Network. Other sites include Company Portal, Image Processing, Astronomy Cameras, Astronomy Cameras Blog, Blog caméras d'astronomie, Astronomy Cameras Competition, TX Text Control, TX Text Control Blog and Forums.