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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Keeping a twain source open

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Tod Posted - Mar 01 2012 : 07:57:23
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
3   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Mar 04 2012 : 13:55:40
Yes, it is correct. TImageEnIO will not acquire multiple pages, sorry! You have to use TImageEnMIO.
Tod Posted - Mar 01 2012 : 08:44:47
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. :-)

fab Posted - Mar 01 2012 : 08:25:20
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).