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
 TIEWia.SetItemPropertyQuestion (Win64)
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

suriyont

USA
18 Posts

Posted - May 07 2015 :  17:55:03  Show Profile  Reply
System: Win 7 Pro 64bit
ImageEn: V6.0.1
Delphi: XE6 Pro
Application Platform: Win64

I am trying to programmatically set the color depth on the WIA scan device before scanning (see below)

ImageEnMView1.MIO.AcquireParams.SetSource(ieaWIA, 'HP Photosmart C309a');
ImageEnMView1.MIO.AcquireParams.BitDepth := 1;
//-- or
ImageEnMView1.MIO.WIAParams.SetItemProperty(WIA_IPA_DEPTH, 1);
ImageEnMView1.MIO.Acquire;

However, I am unable to set the bit depth. Either Methods above fails to set the bit depth.

Please Advise.

Thanks

Suri M.

xequte

38514 Posts

Posted - May 07 2015 :  19:09:15  Show Profile  Reply
Hi Suri

I expect your Twain device/driver does not support the property.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

suriyont

USA
18 Posts

Posted - May 07 2015 :  21:07:44  Show Profile  Reply
Thanks for a quick reply. What puzzling me is that I can set it through the WIA common dialog:

ImageEnMView1.MIO.AcquireParams.SetSource(ieaWIA, 'HP Photosmart C309a');
ImageEnMView1.MIO.AcquireParams.VisibleDialog := True;
ImageEnMView1.MIO.Acquire;

Via dialog I can change the bit depth (set to b/w scan). Somehow within your TIEWia.ShowAcquireDialog(), you are able to set this property.

Thanks,

Suri M.
Go to Top of Page

xequte

38514 Posts

Posted - May 07 2015 :  22:02:06  Show Profile  Reply
Hi Suri

I'm afraid that is not quite the same. When you enable VisibleDialog and call Acquire the driver handles the communication between the configuration dialog and the device without involving ImageEn.

OOI, is BitDepth set after calling Acquire?

To confirm whether the issue is in ImageEn use another library to set WIA_IPA_DEPTH and then modelessly acquire.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

suriyont

USA
18 Posts

Posted - May 08 2015 :  07:52:26  Show Profile  Reply
Hi Nigel,

Yes, BitDepth is set to 1 after the Acquire if I set to B/W from the dialog.

ImageEnView1.IO.AcquireParams.SetSource(ieaWIA, 'HP Photosmart C309a');
ImageEnView1.IO.AcquireParams.VisibleDialog := True;
ImageEnView1.IO.Acquire;
ShowMessage(Format('Bitdepth: %d',[ImageEnView1.IO.AcquireParams.BitDepth]));






Suri M.
Go to Top of Page

suriyont

USA
18 Posts

Posted - May 08 2015 :  10:55:57  Show Profile  Reply
Ok, I think I figure it out from your demo. With WIA api, you can only set WIA_IPA_DATATYPE. This property will then changes the BitDepth accordingly:

//-- 0 = b/w format
ImageEnView1.IO.WIAParams.SetItemProperty(WIA_IPA_DATATYPE, 0);
ImageEnView1.IO.Acquire;


Thanks,


Suri M.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: