VintaSoft Twain .NET SDK Discussions

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions

We are migrating to new forums engine, no new registration or posting currently available. TIA for your patience.

device.Setup()



device.Setup()

Post by simp513 »

Setup Opens and closes imediatly.
If I comment out the _deviceManager.Devices.Current.Close(); and _deviceManager.Close(); it stays open until I close it....Problem is, I'm leaving the device open and I don't want to.
//Scanner Settings
_deviceManager.Open();
if (_deviceManager.Devices.Count > 0)
{
if (_deviceManager.Devices.Select())
{
// get reference to current device
_device = _deviceManager.Devices.Current;
_device.Open();
_device.Setup();

}

_deviceManager.Devices.Current.Close();
}
else
MessageBox.Show("No Compliant Devices!");
// close the device manager
_deviceManager.Close();


Re: device.Setup()

Post by Alex »

Hello,

Setup dialog can be shown only when device is opened. Setup dialog closes automatically when device closes.

Here is a step sequence which you need do for setup the device:
  • Call the Setup method
  • Change the device settings in the setup dialog
  • Close the setup dialog
  • Acquire image(s) from the device with or without UI if necessary
  • Close the device
Best regards, Alexander


Re: device.Setup()

Post by simp513 »

I understand But there is no event or way of knowing when the setup dialog is closed.


Re: device.Setup()

Post by Alex »

I understand But there is no event or way of knowing when the setup dialog is closed. You need to subscribe to the StateChanged event of the Device class if you want to know when device is closed.

Device is enabled when the setup dialog is opened, device is opened when the setup dialog is closed.

Best regards, Alexander


Page 1 from 1: 1