Forums › TWAIN Classic › From Java with user interface Twain › Reply To: From Java with user interface Twain
@Nicholas Jordan wrote:
@fct wrote:
Also download and use the TWAIN sample application from the twain.org website, it’s useful to list and test the capabilities supported in the scanner.
I have two directories:
Twain_DS_sample01
which has
TWAIN Data Source [DS]
which is a ram resident virtual scanner, and
TWAIN Application
which is a TWAIN Application and gets into vc and so on, I threw away vc a long time ago and use a C/C++ compiler that expects one to dig through the headers yourself, and in doing so I am seeing a great deal of very professonal work.
I’m talking about the already-compiled TWAIN data source application linked from the front page in twain.org.
@Nicholas Jordan wrote:
I had pretty much found that already or knew I would be finding it momentarily as soon as I dug in, intellisense drives me nuts. What I was asking is a “where to start” when I start looking at
TW_UINT8 Index; /* Value used to index into the color table. */
TW_UINT8 Channel1; /* First tri-stimulus value (e.g Red) */
TW_UINT8 Channel2; /* Second tri-stimulus value (e.g Green) */
TW_UINT8 Channel3; /* Third tri-stimulus value (e.g Blue) */and do not have sufficiently informed technical information to dig into. I have tried the magic-button approach and that just will not cut it for where I want this to run. On the opposition postion, I will be in over my head so it is a hell of a job trying to find ground zero in ten acres of code with no cs degree.
You’re looking at data for an 8bpp palette color mode.
That’s neither 8bpp grayscale mode nor 24bpp RGB. It’s almost sure you won’t need to use that.
All the technical information you need to understand how TWAIN works is in the specification. EZTwain classic implements parts of it, but just reading the source (or the TWAIN.H header) won’t cut it if you need to extend EZTwain.
@Nicholas Jordan wrote:
My ui will be driven by Java, this is native code which may pop-up a dialog if it just has to but pretty sure I can do reading on SetHideUI && SetIndicators and figure it out. I have a lot of reading to do, it’s gonna be where to find the values that are passed into these calls and what the rerturn value signifies that is of consequence in my questions.
From the EZTWAIN.H header:
void EZTAPI TWAIN_SetHideUI(int fHide);
int EZTAPI TWAIN_GetHideUI(void);
// These functions control the 'hide source user interface' flag.
// This flag is cleared initially, but if you set it non-zero, then when
// a source is enabled it will be asked to hide its user interface.
// Note that this is only a request - some sources will ignore it!
// This affects AcquireNative, AcquireToClipboard, and EnableSource.
// If the user interface is hidden, you will probably want to set at least
// some of the basic acquisition parameters yourself - see
// SetCurrentUnits, SetBitDepth, SetCurrentPixelType and
// SetCurrentResolution below.
Also, sorry. SetIndicators is a function I implemented myself, it’s not in the EZTwain code you downloaded. But anyway it’s mostly one line using the CAP_INDICATORS capability and the TWAIN_SetCapOneValue function.
@Nicholas Jordan wrote:
@fct wrote:
The functions declared in EZTWAIN.H are also a good way to learn how to program TWAIN.
So I could just start with
HANDLE EZTAPI TWAIN_AcquireNative(HWND hwndApp, unsigned wPixTypes);
and call GlobalFree after the call, wouldn’t that release the handle to the data I just got?
Yes.
@Nicholas Jordan wrote:
Bloating ram is exactly one of the attack vectors I see too much of, I’m a near-nutcase about it.
Then consider implementing either buffered or direct to disk transfers.