ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Probe TWAIN device
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Xylit

13 Posts

Posted - Apr 26 2012 :  03:14:31  Show Profile  Reply
Hi,

I have two twain devices installed. But Only one device is connected to the pc. Is there a way to find out which one of them?

Possibly by looping through all the twain devices, selecting each and ask for scanner information. The one, where I get the information, is connected. But what method gives me information about the scanners?

fab

1310 Posts

Posted - May 01 2012 :  10:23:25  Show Profile  Reply
Hi,
if your device driver supports this feature you can write, for example:
var
  i: integer;
begin
  for i:=0 to ImageEnView1.IO.TwainParams.SourceCount-1 do
  begin
    ImageEnView1.IO.TwainParams.SelectedSource := i;
    if ImageEnView1.IO.TwainParams.DeviceOnline then
      ShowMessage(Format('Device %d (%s) is online', [i, ImageEnView1.IO.TwainParams.SourceName[i]]));
  end;
end;


Unfortunately not all devices supports it. Sometime you will see a scanner dialog with errors (when ImageEn tried to communicate with the device, the driver dialog shows up). Sometime you will see erroneous results (DeviceOnline reports true when the device is offline, and viceversa).
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: