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
 Keeping a twain source open
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Tod

9 Posts

Posted - Mar 01 2012 :  07:57:23  Show Profile  Reply
Hi,

Is there a way to keep a twain source open? Looking at the source, it looks like this really isn't possible. Calling .Update closes the source and source manager.

I have two functions to detect the abilities of the machine. There really isn't an official twain function to determine of a device has a flatbed scanner in addition to a feeder. So I use two functions like this

MIO.TwainParams.FeederEnabled:=true;
MIO.TwainParams.Update;
HasFeeder:=(MIO.TwainParams.FeederEnabled=true);


MIO.TwainParams.FeederEnabled:=false;
MIO.TwainParams.Update;
HasFlatBed:=(MIO.TwainParams.FeederEnabled=false);

Which work well for all the scanners I have.

The problem is that calling .Update opens and closes the source, which can take time. All in all, the source has to be closed and opened 3 times to scan an image. One of my scanners, a Canon, has really poorly designed drivers and throws an exception every time the source is opened if the Delphi debugger is running.

All of this behavior can be avoided if I use WIA mode, but, WIA doesn't appear to support duplex scanning (which I must have) and is considerably slower than Twain.

Its not a show stopper, I have used GDImage SDK a bit in the past, and that has this ability. Being able to leave the source open all the time until I expressly close it would be nice :-)

Thanks

Tod

fab

1310 Posts

Posted - Mar 01 2012 :  08:25:20  Show Profile  Reply
Hi,
only TImageEnIO can leave the source open. Example:
ImageEnView1.IO.AcquireOpen();
...and...when you want to close it....
ImageEnView1.IO.AcquireClose();
Of course you can use a TImageEnIO to send images to TImageEnMView.
It don't know if that is what you actually meant.

Anyway ImageEn leaves open the source (until you call TwainParams.FreeResources()). Of course Update() can require some time to update all properties, however you could save the availability of the feeder on same place and retrieve it (just an idea). We hope to add a way to know all supported features of a device in a next release.

About WIA it should support duplex scanning (look at WIA_DPS_DOCUMENT_HANDLING_SELECT = WIA_DUPLEX).
Go to Top of Page

Tod

9 Posts

Posted - Mar 01 2012 :  08:44:47  Show Profile  Reply
Will a TImageEnIO operate properly with an automatic feeder? I was under the impression to use the auto feeder (AutoScan and AutoFeed=true), I had to use a TImageEnMIO.

Looking at the source code, please correct me if I am wrong, but .update always closes the source. These lines are always being executed.

IETW_CloseSource(grec);
IETW_CloseSourceManager(grec, wnd);
IETW_UnloadSourceManager(grec, false);

With the two scanners I have at my development station, a Fujitsu 5650c and a Cannon MX7600, both have duplex ability. Both work great with twain in full duplex mode. However both report Duplex ability as False when used with WIA. I even tried AcquireParams.DuplexEnabled:=True Neither scanner worked in duplex mode.

It would be great to have that capability detection added in the next release. :-)

Go to Top of Page

fab

1310 Posts

Posted - Mar 04 2012 :  13:55:40  Show Profile  Reply
Yes, it is correct. TImageEnIO will not acquire multiple pages, sorry! You have to use TImageEnMIO.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: