Grabber::loadDeviceState Method

Restores grabber settings that were saved by saveDeviceState.
Syntax:
bool loadDeviceState( const std::string& xmlStr, bool bOpenDev = true );
bool loadDeviceState( const std::wstring& xmlStr, bool bOpenDev = true );

Parameter Description
xmlStr

Specifies a string that holds the settings. This string can be obtained by calling saveDeviceState.

bOpenDev

If the parameter is set to true, the method tries to open the device that is specified by the settings data. If the parameter is false, no device will be opened, but the settings data will be applied to a device that is already opened.

Return value:

true, if the device state is successfully loaded. If an error occurred, you can call getLastError to retrieve the error code. Malformed XML data in xmlStr causes the error value to be set to eINVALID_PARAM_VAL. If the data is incompatible with this version of IC Imaging Control, the error code is eINCOMPATIBLE_VERSION. eINCOMPLETE tells that not all properties could be initialized with the values in the data string.

Remarks:

If the parameter bOpenDev is set to true, a device specified by its name and its serial number which are stored in the settings data will be opened. If the parameter is set to false, the settings are applied to a device that is already open. The device to which the settings are applied must be of the same type than the device from which the settings data originates.

Information:

Introduced in version 2.0

Sample:

For an example of how to save and load Grabber states, see saveDeviceState

See also: saveDeviceState

<< Grabber