Forum Replies Created
- AuthorPosts
I really think you are wrong in that the dll doesn’t provide the dialog. The code snippit is the point at which the dialog is shown. If you have every tried the implementations provided by Asprise or Morena Studio then same dialog box is displayed. It’s obvious that you haven’t used this dialog or had this problem so I don’t think you can answer my original question.
I believe the Windows dialog boxes referred to are those used to select the source and it’s settings and the box provided by the device. In his earlier example, he created Windows dialog boxes within his dll instead of using the one provided by the twain_32.dll. I’m using Jeff’s code so I’m pretty sure the generic acquire dialog is to be shown. Here’s a clip from the acquire method which shows the dialog:
...
#include "twain.h" // Standard TWAIN header.
...
// Prepare to enable the currently open data source. Make sure to NOT show
// the data source's own user interface (dialog box).
TW_USERINTERFACE ui;
ui.ShowUI = FALSE;
ui.ModalUI = FALSE;
ui.hParent = 0;
// Enable the currently open data source.
g_rc = (*g_pDSM_Entry) (&g_AppID,
&g_SrcID,
DG_CONTROL,
DAT_USERINTERFACE,
MSG_ENABLEDS,
&ui);
// If default data source could not be enabled, throw exception. Because
// the exception is not actually thrown until execution returns to Java, we
// first exit current block to close data source, close data source
// manager and destroy the previously-created window.
if (rc != TWRC_SUCCESS)
{
throwJTE (env, "Unable to enable default data source (_acquire)");
EXIT_CURRENT_BLOCK
}
This displays a generic dialog box and not the fancy one from Logitech (the camera’s brand I’m using) I get when I use the web cam alone. Are you saying that this generic dialog is also provided by the manufacturer and not twain_32.dll?
Did you write your own acquisition dialog?
If you dig into the actual source provided with the article, JTwain makes it’s calls to jtwain.dll, which in effect loads and provides a JNI interface to twain_32.dll.
Do you use the twain_32.dll and it’s dialogs or not?
I followed the example given by Jeff Friesen. This can be found at: http://today.java.net/pub/a/today/2005/01/25/twain.html
The sample code is pretty much what I used.
Is there a better way to aquire an image?
I’m using Win XP and the capture dialog which is provided by the TWAIN_32.DLL
When the capture dialog is shown, there is a list of the previously captured images on the right and the live cam on the left. New captures are added to the list on the right.
I would like to clear the list on the right but haven’t figured out how to.
- AuthorPosts