August 16, 2007 at 10:52 am #22197
1. How to get a preview before actual scan (acquire)
2. How to get error messages in my app, like “Calibrate first, papers not ready(I saw a tag for that) but any event message from the device?
Would anyone help with a piece of code in C#?
I see lot of SPAM messages here? aren’t Twain guys cleaning their shop….August 16, 2007 at 12:17 pm #24054
1. if you mean with GETFIRSTFILE msg_getfirstfile than I don’t understand what this has to do with a scan preview.
for a scan preview I would suggest you do a normal scan just with a very low resolution and display it on the screen.
2. be a bit more specific in terms of what you are using for your app: any predefined commands, twack-commands, …..
what kind of error messages are you thinking of? errors occurring during setting the caps, the transfer,… or wrong input from the user?August 16, 2007 at 1:53 pm #24055
Calibrate first, papers not ready or any event message from the device happens when?
You are saying GetFirstFile has nothing to do with pre scan preview and and only to show a preview is to scan the first page and put the up to user?August 16, 2007 at 2:06 pm #24056
MSG_GETFIRSTFILE has nothing to do with a preview scan because it gets you the first file name in a folder see spec 1.9 page 174
to scan the first page and display is is ONE possibility to do a preview scan. maybe there are others but I couldn’t think of any
sorry, but I still have no idea what you mean with your event messages. the device will never ask to be calibrated becaust it is always calibrated with default settings.
if you want to check if there is any paper to be scanned than you have to swicht to automatic document feeder mode IF your scanner supports this, otherwise I don’t think that a scanner can tell if there is any paper to be scanned or notAugust 16, 2007 at 2:45 pm #24057
No, some scanner I saw needs to be first to be calibrated,
Or things like papers not found message box pops up, I want that message transfered to my app, where I would show the message in a level or own messgebox. all the messages generated from a user command to the scanner to be captured by my app just that what I want.August 17, 2007 at 6:37 am #24058
well I don’t think these are error messages from the scanner, but only from the application.
So I would suggest you just add a function to your application, which comes up with an error box if the user tries to scan before having finished the settings.
what does your app look like so far? do you already have some code?August 17, 2007 at 5:55 pm #24059gabeParticipant
- Topics - 9
- Replies - 583
- Total Posts - 592
Or things like papers not found message box pops up,
you don’t like the vendor’s messagebox stopping your triplet? No kidding. That’s frustrating. No, there is no twain call to turn them off.
I want that message transfered to my app, where I would show the message in a level or own messgebox. all the messages generated from a user command to the scanner to be captured by my app just that what I want.
Unfortunately those messages aren’t always available, and there really isn’t a way (from within the twain spec) to get them trasnfered to your app.
My workaround ended up being a second thread that does dialog management for me. I set a shell hook and a second cbt hook for windowactivated/created. then I have the users do stupid stuff like turn off the scanner and try to acquire, or jam a paper in the feeder before trying to acquire. typically you’ll have to watch for the dialogs around the time you call openDs, enableDs or enableDsUiOnly. If any dialogs come up that second thread steps thru it and gathers details to base a rule on for the dialog monitor. In general use the dialog monitor will have an array of meesagesboxes to watch out for and what to do if they show up – usually a postmessage to the ok or Cancel buttons. Worst case is if the users havent made rules for all of the possible messageboxes but the details are logged. When the cbthook catches the dialog you don’t even see it, just hear the beep. The shellhook isn’t as fast – you’ll often see a flash of messagebox before it gets closed.
Once you have that out of the way you’re able to go back to work on the rest of the spec, but I’d have to say that dialog management is key if you’re going to get any production work out of a mid-range scanner.
- This topic has 6 replies, 3 voices, and was last updated 13 years, 5 months ago by .
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)