Home › Forums › TWAIN Classic › Setting DPI sometimes fails
- This topic has 3 replies, 2 voices, and was last updated 16 years, 11 months ago by gabe.
- AuthorPosts
Hello Twain experts,
I have been trying to add scanning support to our application and have therefore tried to implement a twain driver. The software runs rather well, except on some scanners and on some operating system I can not set the DPI value (X nor Y). Retrieving the supported DPIs yields a strange set of values.
E.g. the software works fine with an HP 5590 on windows XP but fails to set the DPI with exactly the same scanner on windows 2000.
1. On the 2yk machine setting the XResolution capability returns an error message: TWRC_FAILURE. But when checking the condition code for this error we find: SUCCESS.
2. When querying the list of supported resolutions the following set of numbers is returned by the device:
200 200 0 0.003723145 788.0001 5.003906 12 0 0.5556793 30677.38 25.34644 24.00002
On the XP machine this returns the normal set of values 75 100 200 300 600 1200 2400
I guess I’m missing something !
Any tips, ideas would be highly appreciated.Thanks,
borisICAP_XRESOLUTION and ICAP_YRESOLUTION are TW_FIX32, which when I wrote my wrapper were tricky (yeah I’m slow). If I were to guess, I’d say your TW_FIX32 logic isn’t quite right ot the vendor is misbehaving. If you want to post the code or logic you use to read the take pointer and get a TW_FIX32 out of it, someone here might be able to help. Also, if you let us know what vendor and driver (and version) you see this on someone (probably spike, as Dosadi _must_ have to have a massive library of scanner properties and quirks) may know if the driver is odd across platforms.
rc= failure and cc=success I’ve seen. I treat those as a success. Double check that you aren’t calling the cc twice as the cc is (should be if the vendor follows the api, but.. well that isn’t always or even usually the case) reset after you call it and if you’re checking the second read instead of the first then you’re looking in the wrong place.
Hello Gabe,
Hello all,It could be that my Fix32 contains some errors, but on a number of machines the code is working just fine. Therefore I’m not a 100% convinced that it is the code (although it usually is 🙁 )
I will start by posting about the scanner and drivers, maybe someone knows something about them (or the combination of them).
The scanner I’m using is a hp scanjet 5590 and the driver details are:
On windows XP professional (everything working fine)
provider: Hewlett-Packard
date: 11/01/2007
version: 8.1.0.73Driver files:
usbscan.sys (5.1.2600.2180)
hp5590co.dll (8.1.0.73)
hpgt5590.dll (1.3.0.0)
hpxp5590.dll (8.1.0.73)I have also tested with another scanner (Dell Photo AIO Printer 964) which appears to work fine on both of these platforms.
Thanks again for any help,
boris
On windows 2000 (DPI issues)Provider: Hewlett-Packard
Date: 18/12/2003
Version: 2.1.1.2Driver files:
usbscan.sys (5.00.2195.6655)
hp5590co.dll (2.9.4.570)
hpgt5590.dll (1.3.0.570)
hpgtpusd.dll (1.3.2.570)
hpqgends.tmp (1.1.0.570)or test with the twacker sample app. If twacker gives you the results that you get on winXP, then your code is odd. If twacker gives you screwed up values then the source is odd (…but in all fairness we already know the source is at least a little bit odd cause HP made it, we just don’t know if this is a part of it’s oddness)
- AuthorPosts