IC Imaging Control C++

Grabber::loadDeviceStateFromFile Method

Grabber::loadDeviceStateFromFile Method

Restores the device settings from a file that was previously saved by saveDeviceStateToFile.
bool loadDeviceStateFromFile( const std::string& filename, bool bOpenDev = true );
bool loadDeviceStateFromFile( const std::wstring& filename, bool bOpenDev = true );

Parameter Description

Specifies the XML file that contains the settings data.


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 an already opened device.

Return value:

true, if the operation was successful, otherwise false. Call getLastError for extended error information.


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 as the device from which the settings data originate.


Introduced in version 2.0

See also: saveDeviceStateToFile

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