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
 Inconsistent results with IO.SetAcquireSource

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
skippix Posted - Jun 29 2014 : 15:06:39
I have a combobox with a list of digital cameras attached to a pc and a treeview that gets populated when the user selects one of the listed cameras.


ImageEnView1.IO.TwainParams.SelectedSource := Camera1.ItemIndex;
ImageEnView1.IO.SetAcquireSource(ieaWIA, Camera1.ItemIndex);

TreeView1.Items.Clear;
ImageEnView1.IO.WIAParams.FillTreeView(TreeView1.Items, False);
TreeView1.FullExpand;


This works fine on my laptop that is running Windows 8.1, but is failing on my desktop that is running Windows 7 in that the only item listed in the treeview is "...DCIM"

Note: I originally tried the code
ImageEnView1.IO.SetAcquireSource(iDeviceSource.Api, iDeviceSource.Location)


but that did not update the treeview when the user picked a different device; as that seems to only use the first device on the list, I modified the code.

Any ideas? Thanks!
4   L A T E S T    R E P L I E S    (Newest First)
skippix Posted - Jul 01 2014 : 03:35:00
I understand, and I think I'm going to have to leave it to my users to learn for themselves which option to pick. Unless there is a specific, detectable property in the individual device drivers, I don't think there's any way to anticipate all the possibilities.
xequte Posted - Jun 30 2014 : 19:16:03
Hi

ImageEn will return all devices that have WIA drivers on your system, so if you want to exclude devices then you will need to parse the list ImageEn returns to exclude those that do not match your criteria.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
skippix Posted - Jun 30 2014 : 14:09:12
Thanks!


ImageEnView1.IO.AcquireParams.FillListWithSources(Camera1.Items, [ieaWIA], False);

does the trick.

The only thing I'm finding odd is that this also returns my memory-card reader as a WIA device. I would really like some way to avoid that, as the transfer through ImageEnView.IO is ridiculously slow compared to a simple CopyFile. While my users can barely tell the difference between the two when it comes to picking an import method (copy-from-camera vs copy-from-card-reader), they can definitely tell the difference in performance.

Any ideas?
xequte Posted - Jun 29 2014 : 19:02:46
Hi

Sorry, I'm not quite sure what type of devices you are retrieving/setting as you are using contradictory properties.

ImageEnView1.IO.TwainParams.SelectedSource := Camera1.ItemIndex;

Here you are using TwainParams, the Twain interface, so Camera1.ItemIndex is only accurate if Camera1 has been filled with Twain devices, e.g.

for q := 0 to ImageEnView1.IO.TwainParams.SourceCount-1 do
  ListBox1.Items.Add( ImageEnView1.IO.TwainParams.SourceName[q] );


Whereas here: ImageEnView1.IO.SetAcquireSource(ieaWIA, Camera1.ItemIndex);

You are using AcquireParams, which is ImageEn generic interface (to all Twain/WIA/DCIM devices). Which needs to be filled using IO.AcquireParams.FillListWithSources

I recommend you take a look at the "Acquire from Any Source" demo:

http://www.imageen.com/demos/

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com