Home › Forums › TWAIN Classic › SET_AUTOSCAN to true in java.
- This topic has 1 reply, 2 voices, and was last updated 11 years, 4 months ago by spike.
- AuthorPosts
Personal Greetings.
Could someone help me?
I’m developing a java code to scan the images, I’m using windows dll free twain_32.dll for that.
however I am not able to enable CAP_AUTOSCAN true?
where I put the CAP_AUTOSCAN to true?
my code follows:
private static int setAutoScan (TW_IDENTITY application,
TW_IDENTITY src, int hwnd) {TW_CAPABILITY TW_CAPABILITY = new CAP ();
CAP.Cap = JTwain.CAP_AUTOSCAN;
CAP.ConType = TWON_ONEVALUE;
CAP.hContainer = hwnd;
int stat = twain.DSM_Entry (application, src,
DG_CONTROL,
DAT_CAPABILITY,
MSG_SET,
CAP);OK… I wrote that DLL, and I don’t understand what you’re doing 😉
Do you have other code that is working, and you are just adding this? What happens?
How do you know CAP_AUTOSCAN is FALSE?
(It’s almost always TRUE by default.)
What scanner are you working with?You really need to read the TWAIN spec if you’re going to work at this level.
http://twain.org/scannerdriverdevelopers/specification-and-tools.html
The CAP.hContainer isn’t a Window handle, it’s a GlobalHandle to a structure described in the TWAIN specification – see the TW_ONEVALUE structure. There’s some example code on page 4-13 of the Version 2.2 specification, that shows a TW_ONEVALUE being created and used to set a capability.- AuthorPosts