Home › Forums › TWAIN Classic › Simple capability setting
- This topic has 5 replies, 2 voices, and was last updated 15 years, 11 months ago by gabe.
- AuthorPosts
Hi. My application lets me select and open the source. Then a routine is called to set these capabilites: CAP_XFERCOUNT to 1 and ICAP_UNITS to TWUN_INCHES.
The very same routine that successfully sets CAP_XFERCOUNT, miserably fails when setting ICAP_UNITS: the returned condition code is “bad value”, and this is something that is driving me mad.
How is it possible ? Setting simple capabilites like these should be extremely easy, and it is. Note that the returned condition code is not “unsupported capability”.
Can anybody give some hints to me ?
Thanks. Alvise.
just for kicks, and along the lines of my other post, try the same code on the same hardware – same drivers with a different compiler. Do you have an MS ide you can test with? Even one of the free c++ express should be sufficient to test thsi idea.
And on the side, what device are you test with?.
Hi Gabe:
>> try the same code on the same hardware
>> same drivers with a different compilerI already changed the compiler. Now I am developing in assembly with the old good MASM32, and the results are better: no more need to patch structures. But getting x and y resolution always returns a container structure that is different from the one described in twain.inc
>> And on the side, what device are you test with?
Avision AV 820C. But I have ordered a Kodak i1210 and it should be arriving this week.
I am also planning to change the development PC and install another copy of WinXP.
Regards. Alvise.
…I have ordered a Kodak i1210 and it should be arriving this week.
If you test with an i30 driver set in simulation mode we could compare notes in a more meaningful way. The i1210’s simulator is decent but doesn’t seem to offer the same level of simulation. Plus, with the simulation mode you wouldn’t have to wait for delivery. And I have found the simulation to mimic live hardware very very well.
.
Hi Gabe. Yesterday I received the Kodak i1210 scanner, I’ve installed it, and now I finally can scan a page and get the bitmap.
But the fact is that the image is mirrored both vertically and horizontally (plus black and white pixels are swapped, but this is less important).
Is there anything that I am missing ? Should I write a routine to reverse the image upside down, left to right, and to get the proper pixel colors ? Why doesnt’ the scanner provide the correct image straight out of the scan ?
Thanks. Alvise.
the mirror effect you’re describing is common and is partially to do with your transfer mode. I’m pretty sure you’ll see a function in Dosadi’s sample with ‘flip’ in the functionName. You’ll also see this behavior described in some of the samples dealing with DIBs. hit google up for ‘DIB bitmap upside down’.
.
- AuthorPosts