device.Setup()

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

Moderator: Alex

Post Reply
simp513
Posts: 4
Joined: Thu Oct 04, 2012 11:06 pm

device.Setup()

Post by simp513 » Thu Oct 04, 2012 11:10 pm

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

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: device.Setup()

Post by Alex » Fri Oct 05, 2012 8:11 am

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

simp513
Posts: 4
Joined: Thu Oct 04, 2012 11:06 pm

Re: device.Setup()

Post by simp513 » Fri Oct 05, 2012 12:35 pm

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

Alex
Site Admin
Posts: 1445
Joined: Thu Jul 10, 2008 2:21 pm

Re: device.Setup()

Post by Alex » Fri Oct 05, 2012 3:46 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest