IC Imaging Control C++

saveToFileTIFF Method

saveToFileTIFF Method

This function saves the contents of an image buffer to a TIFF file.
Error saveToFileTIFF( const IFrame& buf, const std::string& filename );
Error saveToFileTIFF( const IFrame& buf, const std::wstring& filename );
Error saveToFileTIFF( const IFrame& buf, const wchar_t* pFilename );

Parameter Description

The buffer that is to be saved.


Specifies the filename of the TIFF file.


Specifies the filename of the TIFF file.

Return value:

This method returns an error object. If successful, it is set to eNOERROR. If the format of the image buffer can not be converted to TIFF, eINVALID_PARAM_VAL is returned. If the file can not be written, the error status is eWRITE_ERROR.


This method only supports image buffer formats Y800, Y16, RGB24, RGB32 and RGB64.


Namespace: DShowLib
Introduced in version 3.3


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

if( m_Grabber.isLive())
    // This cast is only valid, if we have previously assigned a FrameHandlerSink to the grabber.
    tFrameHandlerSinkPtr pSink = static_smart_ptr_cast<FrameHandlerSink>(m_Grabber.getSinkTypePtr() );
    Error err = pSink->snapImages( 1 );
    if( !err.isError() )
        DShowLib::saveToFileTIFF( *pSink->getLastAcqMemBuffer(), "Testimage.tiff" );

See also: IFrame, MemBuffer, saveToFileBMP, saveToFileJPEG

<< Functions

Get in touch with us

About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, video converters and embedded vision components for factory automation, quality assurance, medicine, science, security and a variety of other markets.

Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE, MIPI interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.

ISO 9001:2015 certified MVTEC | Edge AI + Vision Alliance | EMVA

Contact us