Home › Forums › TWAIN Classic › From Java with user interface Twain › Reply To: From Java with user interface Twain
Before I run some code and tear up my only machine that I can use for a development platform:
int EZTAPI TWAIN_IsAvailable(void);
goes to ( … terminology… ) the operating system, sort of a shell that calls into kernel mode, returning true ( non-zero ) if a device of some kind has been installed on the system that supports twain – correct?
@fct wrote:
“Use of operation triplets” in the TWAIN 1.9 spec. It’s necessary to know about how triplets work to setup the scanner. The spec also has a list of icaps with explanations about their functionality and parameters. With that basis and the functions in EZTwain it’s easy to change parameters. It’s important to spend some time going over the TWAIN spec (at least the sections relevant to application developers).
I’m gonna be awhile on this, will have to check back ( re-post ) if addional research leads are needed.
@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.
@fct wrote:
The ICAP you’re asking about is in the TWAIN.H file. Once you incorporate that header file to your project, if you’re using Visual Studio with autocomplete/intellisense enabled you can just type “tw” and control+space to get a list of TWAIN-related declarations.
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.
@fct wrote:
To use the library with no UI displaying, check the EZTwain functions TWAIN_SetHideUI and TWAIN_SetIndicators.
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. Documentaton, so called becaue it is, does not do me any good when it insists on calling throgh the shell to give me the documentation, I run in raw text mode with editors that do not have to do a context switch on every character and consider it a litmus test of the beginner to be able to dig throgh 10k headers and find in things almost as fast as the intellisense but without the intrusion from the sales department that brings.
It doesn’t do any good to use that stuff if one has to kowtow to help department from hell and breaks the budget.
@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? I mean I was looking a little deeper and for some reason someone had done the load with copy semantics. I understand how that stuff gets started, STL has a lot of it and we have some very good reasons why that happens but if I call something and it just has to do copy-semantics then it can write the copy to a pointer I alloc and it needs to free the pointer it alloc’d after passsing the buffer.
Bloating ram is exactly one of the attack vectors I see too much of, I’m a near-nutcase about it.