Setting Resolution

Sep 6, 2011 at 10:32 PM


I have been using this project as the basis of a little project that I am running for myself. I am really keen to use an open source solution to TWAIN scanning. Using this code I am able to get the current values of capabilities, scan in multiple images etc... what I would really like to do is be able to programmatically set the x and y resolution.

I keep getting an rc=failure when I try and do this using the following code:


Dim xresv As New twOneValue       

xresv.Item = 200       

xresv.ItemType = TwType.Fix32
Dim xres As twCapability = New twCapability(TwCap.ICAP_XRESOLUTION, xresv)
rc = DScap(appid, srcds, TwDG.Control, TwDAT.Capability, TwMSG.Set, xres)


I if I use the GUI of the scanner I know that 200 dpi is a usable resolution, and am able to set the ICAP_UNITS to pixels (at first it was in cm I think and i thought that is why it would not set the resolution that high.

I am using the kodack i40 in simulation mode as I do not have a batch scanner at present.

Any help would be greatly appreciated



Mar 2, 2012 at 2:11 PM

did you set the units first?  what do you get if you send the Get first?