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
 twain driver question

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
pierrotsc Posted - Sep 16 2011 : 11:56:17
I am trying to implement thhe scanning options using twain drivers.
If i have my scanner turned off, the program still detect that a twain driver was installed and will give me an out of bound error trying to initialize that. I also tried the twain demo that gives the same result.
i have:
for i:=0 to imageenvect.io.twainparams.sourcecount -1 do
....//filling up a combobox

Is there a way i can detect if a scanner is turned on to avoid the error if not.
Thanks.
Pierre
4   L A T E S T    R E P L I E S    (Newest First)
fab Posted - Sep 23 2011 : 22:53:05
Unfortunately I don't know a way to know if a scanner is connected or not.
The twainparams.sourcecount list is read directly from the operating system (TWain device manager).
pierrotsc Posted - Sep 23 2011 : 10:33:05
Nope, that is still not working. The issue with the twain driver is that it is always there even if the scanner is not connected. So the imageenvect.io.twainparams.sourcecount is always greater than 0. That does not happen with WIA. If the scanner is not connected, no WIA is loaded.
I need to find away to fill up my combobox with scanner name only if the scanners are turned on. I do not want to have a requester asking me to chose a scanner like with ImageEnView1.IO.SelectAcquireSource(ieaTWain);
Anyway to detect in the background if a twai scanner is turned on or off?
Thanks.
P
pierrotsc Posted - Sep 20 2011 : 12:12:59
I found out by using if imageenvect.io.twainparams.sourcecount >0 then enable button will prevent enabling the scanning button.
Thanks for the answer.
P
PS: If your scanner is turned off and you try your command, I think you get the error.
klausdoege Posted - Sep 17 2011 : 09:38:07
Hello,
maybe, you can first try that !
ImageEnView1.IO.SelectAcquireSource(ieaTWain);

Klaus