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
 Imageen + wia + acquireframeenabled = Wrong acquisition
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

mastinf

Italy
46 Posts

Posted - Feb 28 2025 :  10:32:23  Show Profile  Reply
I don't have problems with TWAIN drivers but now i have to compile 64bit my application and so have to use WIA driver.

I use this code to set the frame and acquire it:

img.IO.AcquireParams.VisibleDialog:=false; // img is a TImageEnView
img.IO.AcquireParams.AcquireFrameEnabled:= true;
img.IO.AcquireParams.AcquireFrameLeft:= x;
img.IO.AcquireParams.AcquireFrameTop:= y;
img.IO.AcquireParams.AcquireFrameRight:= r;
img.IO.AcquireParams.AcquireFrameBottom:= b;
img.IO.Acquire;


The frame acquired is not correct: a different area is acquired.

The odd thing is that if, after the value has been set, i check in the debugger the value of AcquireFrameRight and AcquireFrameBottom i see that it's 0

Bug or what ?

ImageEn Ver. 13.7.0 and Delphi 10.2.3

Roberto Nicchi
Master Informatica
Italy

xequte

38875 Posts

Posted - Feb 28 2025 :  19:29:39  Show Profile  Reply
Hi Roberto

Ensure that you are not resetting the values before the acquire, e.g. by re-connecting to the device.

Otherwise it's possible the scanner does not support that via the WIA interface. Can you try setting the properties manually using this demo:

attach/xequte/2025228192934_WIAScanner.zip
19.4 KB

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

mastinf

Italy
46 Posts

Posted - Mar 03 2025 :  10:45:41  Show Profile  Reply
I have tried with the Scan WIA scanner app and i have much better result. Anyway yhe acquisition lack a bit of precision: the acquired image is not exactly the image frame selected. The twain acquisition is better.

I have created a demo app. There a re two buttons: one acquire the image using settings stored in AcquireParams. The ther one is specific for WIA and use SetItemProperty.

I have not been able to use AcquireParams and WIA. The acquired image is most of the time differenmt from the selected frame. Doesn't internally AcquireParams use SetItemProperty when the protocol is WIA ?

If you can let me know if my code used in the demo app is correct.

attach/mastinf/202533103918_ScanDemo.zip
58.4 KB

Roberto Nicchi
Master Informatica
Italy
Go to Top of Page

mastinf

Italy
46 Posts

Posted - Mar 03 2025 :  11:16:20  Show Profile  Reply
I have just tried with an HP scanner (WIA procol) and the image acquired corresponds perfectly to the selected frame if SetItemProperty is used. Using Acquireparams doesn't returns the correct image selected.

Roberto Nicchi
Master Informatica
Italy
Go to Top of Page

xequte

38875 Posts

Posted - Mar 06 2025 :  15:50:42  Show Profile  Reply
Hi Roberto

Sorry, I can get neither to work correctly on my test scanners. Please email me for the latest beta which has improved some WIA methods, including setting the acquire rect (though I can only confirm that it should adhere to the "standard").

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: