IC Imaging Control C++

Grabber::loadDeviceState Method

Grabber::loadDeviceState Method

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

Parameter Description

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


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.


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.


Introduced in version 2.0


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

See also: saveDeviceState

<< 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, 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