IC Imaging Control C++

Grabber::saveDeviceStateToFile Method

Grabber::saveDeviceStateToFile Method

Saves the state of the currently opened device to a file. The grabber state can be restored using loadDeviceStateFromFile.
Syntax:
bool saveDeviceStateToFile( const std::string& filename, bool bDevice, bool bGrabberDeviceSetup = true, bool bVCDProperties = true  );
bool saveDeviceStateToFile( const std::wstring& filename, bool bDevice, bool bGrabberDeviceSetup = true, bool bVCDProperties = true  );

Parameter Description
filename

Specifies the filename of the settings data file.

bDevice

When this parameter is set to true, the currently opened device's name and serial number are saved.

bGrabberDeviceSetup

When this parameter is set to true, the currently selected Video Norm, Video Format, Input Channel, FPS, FlipH and FlipV are saved.

bVCDProperties

When this parameter is set to true, the VCDProperties of the currently opened device are saved.

Return value:

true, if the operation was successful. If an error occurred, call getLastError to obtain extended error information.

Remarks:

The settings data file contains the opened device's settings in XML format. The file contains exactly the same information as the string returned by saveDeviceState.

Information:

Introduced in version 2.0

Sample:
// Save the device state to "device.xml".
m_Grabber.saveDeviceStateToFile( "device.xml" );
// Close the device.
m_Grabber.closeDev();
// The device is now closed. Open the saved device.
m_Grabber.loadDeviceStateFromFile( "device.xml" );
// Show live video again.
m_Grabber.startLive();

See also: loadDeviceStateFromFile

<< Grabber

Get in touch with us


About The Imaging Source

Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.

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

Automated Imaging Association ISO 9001:2015 certified

Contact us