Forum Replies Created
- AuthorPosts
For those who are interested: into the TW_ID_ENT_ITY structure I’ve changed:
TW_UINT32 SupportedGroups;
into:
TW_UINT16 SupportedGroups;
TW_UINT16 dummy;and now everything works fine. The dummy word is set to zero.
Without the dummy word the following TW_STR32 strings would get shifted a couple of bytes right.
Alvise.
Hi Gabe, thanks for your response. I’ll start with i1210 and eventually will turn to i50.
Regards. Alvise.
Hi Jim, I’ve added the directive that you have suggested (#pragma pack (2)), but this did not solve the problems.
Regards. Alvise.
Kodak i1200 series scanner.
Hi Jim, thanks for your interest. I am not defining my own structures, I have naturally included twain.h “as is”. I am using an old -but good- RAD, the Borland C++ Builder Pro release 3 (ehm, it dates back to 1997…) that I have installed in my Windows XP PC.
The pragma directive that you mention is obviously included in the header, but in the “#else” case of an “#ifdef __BORLANDC__” structure.
I am wondering whether I should reverse the cases in the ifdef structure, but I am not that expert to take such an initiative. At the same time I am wondering whether the absence of the #pragma pack (2) directive could be the cause of all the troubles that I am stumbling into (lots of TWCC_BADVALUE” when setting capabilities).
I need to get uncompressed B&W letter size images at 200 dpi from any TWAIN scanner, and I also am in a hurry. I am also considering to switch using the ISIS device driver, although this would mean restart programming from scratch.
Regards from Alvise.
I can’t answer to your question, I’ve corrected my header myself. The fact is the following: after a few hours of debug I noticed that the following strings:
TW_I_DEN_TI_TY.Manufacturer
TW_I_DEN_TI_TY.ProductFamily
TW_I_DEN_TI_TY.ProductNamewere shifted 2 bytes left. I.e: KODAK would have read DAK. And the SupportedGroups was an impossible number. As soon as I have modified the type of SupportedGroups from TW_UINT32 from TW_UINT16 all the strings got right (i.e.: KODAK was read KODAK) and the SupportedGroups was the true OR of DG_CONTROL and DG_IMAGE. Incredible, but true.
Now I am spending my time trying to set a TW_FIX32 capability (CAP_XRESOLUTION) using a TWON_ONEVALUE container. It looks like a “mission impossible”.
Any help about this ?
Alvise
Gabe said: “All of the Kodak drivers have a simulation mode that allows you to test their devices. Download the drivers for the Kodak i100, i200 or i600 (or whatever device you’re interested in). then go into %windir%twain_32kodak
you’ll see a ‘a shortcut to const.ini’ and a ‘a shortcut to ramscan.txt’ “ I have found const.ini and I’ve set simulation=true (was false).
(ramscan.txt not found)
Thank you. Regards. Alvise.
I don’t want the user interface to be displayed, and I want to set the resolution and the scanning area programatically.
I have read more accurately paragraph “Changing the Image Attributes” (TWAIN 1.9a spec, page 4-88) and you’re right: TW_IMAGEINFO can’t be used to set scanning parameters using the DG_IMAGE / DAT_IMAGELAYOUT / MSG_SET triplet.
According to that paragraph I should use TW_IMAGELAYOUT, but the contents of this latter structure can’t be used to set the parameters that I need. TW_IMAGEINFO, on the contrary, is exactly the structure containing the parameters that I want to set. And it works: every parameter appears to be properly set. The only problem is that I get the “TWCC_BADVALUE” condition code. That’s all.
I just want to perform one simple task: scan a B&W letter size sheet at 200 dpi and get the uncompressed data. But it appears to be a pretty difficult task using TWAIN.
Regards from Alvise.
- AuthorPosts