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
 SetAcquireSource error

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
John Posted - Mar 21 2014 : 14:10:34
Hello

For SetAcquireSource, the help file states the following.
"Programatically set the selected acquisition source by an API type and device. The selected device will be used for subsequent calls to Acquire. Result is false if the device cannot be selected (i.e. is not connected or does not exist)."

However, the following if statement returns true even if the scanner is not attached.


var
tempDefaultScannerLocation: Integer

if ImageEnView1.IO.SetAcquireSource(ieaTwain, tempDefaultScannerLocation) = True then
showmessage('true')
else
showmessage('false');


Is this an error or am I missing something?

TIA

John

1   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Mar 21 2014 : 14:24:25
John,

The ImageEn Twain can detect if the twain drivers are installed in windows, but the ImageEn Twain or for that matter any twain can not be used to determine if the scanner is turned on. You can search for this on the web, but you will find there is no way to determine if a scanner is on via twain.

This approach works with digital camera and WIA, but there is no method you can call to know if a camera is plugged in or turned on:
for i := 0 to ImageEnView1.IO.WIAParams.DevicesInfoCount - 1 do
  if ImageEnView1.IO.WIAParams.DevicesInfo[i].DeviceType = iewDigitalCamera
    then
      Camera1.Items.Add(ImageEnView1.IO.WIAParams.DevicesInfo[i].Name);
  if Camera1.Items.Count = 0 then
  'Camera is not plugged in or turned on'

I just tried this with a usb HP Scanner..
if ImageEnView1.IO.WIAParams.DevicesInfo[i].DeviceType = iewScanner;

Even though the scanner is off there still is a device loaded into the combobox. So I guess it depends on the devices software implementation.

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
Custom ImageEn Development