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 ); |
||||||||||||||||||||||
|
|||||||||||||||||||||||
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 |