Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Greetings Fellow Monks!
Operating System: Windows XP w/ a GigaWare 2.0 Mpixel USB Camera attached.
Windows properly recognzies the camera. The goal is to capture an image with the perl script written below and save the image.

#!/usr/bin/perl -w use strict; use Win32::API; use Win32::Scanner::EZTWAIN; my $path_to_dll="C:\\EZTW32\\eztw32.dll"; my $scanner = new Win32::Scanner::EZTWAIN(-dll => $path_to_dll); $scanner->select_image_source(); $scanner->acquire_to_file("P:\\USB-Camera-Image-Capture\\test.bmp" +);
However... when I run the script it fails with this error:
P:\>test686.pl Importing API call TWAIN_SelectImageSource failed at P:\test686.pl line 9

Being new to this particular area of perl, my question simple is: What am I doing wrong?
Any insight and or wisdom provided to get this working properly would be greatly appreciated!
Thanks in advance.

Replies are listed 'Best First'.
Re: USB Camera Image Capture w/ Win32::Scanner::EZTWAIN
by cdarke (Prior) on Apr 14, 2010 at 18:31 UTC
    I don't know this module but, looking at the code, I would set my $path_to_dll="C:\\EZTW32\\";. That is, do not include the dll name.
      Thanks... that has yielded initial success...
      now I have to work throught the popup window that appears... going for total automation
Re: USB Camera Image Capture w/ Win32::Scanner::EZTWAIN
by Corion (Patriarch) on Apr 14, 2010 at 18:34 UTC

    Are you sure that your camera is accessible through the TWAIN interface? Are there other programs using TWAIN with which you can verify that?

      yes... indeed that much is certain....
      now I just want to be able to skip the window, run the script capturing the image saving it to my HDD