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
 Inconsistent results with IO.SetAcquireSource
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

skippix

USA
68 Posts

Posted - Jun 29 2014 :  15:06:39  Show Profile  Reply
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!

xequte

39053 Posts

Posted - Jun 29 2014 :  19:02:46  Show Profile  Reply
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
Go to Top of Page

skippix

USA
68 Posts

Posted - Jun 30 2014 :  14:09:12  Show Profile  Reply
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?
Go to Top of Page

xequte

39053 Posts

Posted - Jun 30 2014 :  19:16:03  Show Profile  Reply
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
Go to Top of Page

skippix

USA
68 Posts

Posted - Jul 01 2014 :  03:35:00  Show Profile  Reply
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.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: