Author |
Topic  |
|
suriyont

USA
18 Posts |
Posted - May 07 2015 : 17:55:03
|
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
    
38988 Posts |
Posted - May 07 2015 : 19:09:15
|
Hi Suri
I expect your Twain device/driver does not support the property.
Nigel Xequte Software www.xequte.com nigel@xequte.com
|
 |
|
suriyont

USA
18 Posts |
Posted - May 07 2015 : 21:07:44
|
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. |
 |
|
xequte
    
38988 Posts |
Posted - May 07 2015 : 22:02:06
|
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
|
 |
|
suriyont

USA
18 Posts |
Posted - May 08 2015 : 07:52:26
|
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. |
 |
|
suriyont

USA
18 Posts |
Posted - May 08 2015 : 10:55:57
|
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. |
 |
|
|
Topic  |
|