can't use AcquiredImage methods when device.showUI=true

Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.

Moderator: Alex

Post Reply
tszanon
Posts: 3
Joined: Fri Dec 10, 2010 8:59 pm

can't use AcquiredImage methods when device.showUI=true

Post by tszanon »

I'm having problems when setting device.showUI=true.
In ImageAcquired event, I can assign the image acquired to a variable, but I can't use it:
Dim img as AcquiredImage
img = e.Image ' OR img = device.AcquiredImages(0), both work fine

But I can't call any method of that image. Whatever I try, I get the very same error message: "Attempted to read or write protected memory".
Can't deskew, despeckle, detect border, save to stream, nothing. Whatever I try, that error is fired.

If I set device.showUI = false, everything works fine.

Scanner: Fujitsu fi-6140
Version: VintaSoftTwain.NET SDK 7.0

What may be happening?
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: can't use AcquiredImage methods when device.showUI=true

Post by Alex »

Hello,

I think the AcquiredImage object is disposed when you use it. Please read description of the Capability property of the AcquiredImageCollection class in the documentation. We will add the Disposed property to the AcquiredImage class in next version of SDK.

Best regards, Alexander
tszanon
Posts: 3
Joined: Fri Dec 10, 2010 8:59 pm

Re: can't use AcquiredImage methods when device.showUI=true

Post by tszanon »

Hello Alex,

According to the debug tool in Visual Studio, the AcquiredImage object wasn't disposed. Maybe some private property may have been disposed, but the object itself is ok.

Capability property of the AcquiredImageCollection? According to the documentation I have, there's no Capability property there, nor Visual Studio finds it...maybe there's a newer version of the library than the one I'm currently using? I'll check it out.

What really bugs me is that the very same code works perfectly if I just set device.showUI=false. It doesn't make any sense to me.
Is there anything else I should check? I'm kind of lost.

Thanks for your help.
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: can't use AcquiredImage methods when device.showUI=true

Post by Alex »

Hello,

AcquiredImage class has the Disposed property since version 7.0.23.1 of SDK, please use this version and try to find the problem.

Send the project which demonstrates your problem to support@vintasoft.com if you cannot solve the problem.

Best regards, Alexander
tszanon
Posts: 3
Joined: Fri Dec 10, 2010 8:59 pm

Re: can't use AcquiredImage methods when device.showUI=true

Post by tszanon »

Indeed, the old version I was using was causing the problem. Updating the library corrected this problem.
Thanks!

P.S. It seems the download page is wrong, it says it's version 7.0.21.1
Alex
Site Admin
Posts: 2303
Joined: Thu Jul 10, 2008 2:21 pm

Re: can't use AcquiredImage methods when device.showUI=true

Post by Alex »

Thank you for comment - fixed.

Best regards, Alexander
Post Reply