Version 2 of Operating TWAIN Scanners through TCL and EZTWAIN.

Updated 2006-09-10 08:30:40

WJG (10/Sep/06) A quick search for Tcl/Tk resources to access TWAIN devices doesn't reveal much. There's Xbit but this is not-opensource. A quick Google Search only provides details of a small handful of development resources which are quite pricy for simple one-off projects. DOSDADI supply an excelling commercial package which does everything yet also have release the first version

 #---------------
 # Tcl_EZTWAIN.tcl
 #---------------
 # Convert required functions in EZTW32.dll into Tcl proceedures using Ffidl
 #
 # EZTW32.DLL  http://www.dosadi.com/eztwain1.htm
 # ffidl.dll   http://rutherglen.ics.mq.edu.au/~steffen/tcltk/ffidl/doc/

 load ffidl05.dll

 #---------------
 # Basic Calls
 #---------------
 ffidl::callout EZ_TWAIN_AcquireToFilename {long pointer-utf8 } int [ffidl::symbol EZTW32.dll   TWAIN_AcquireToFilename]

 #---------------
 # select source and pre-scan and acquire to file
 #---------------
 proc demo {} {
  EZ_TWAIN_AcquireToFilename 0 Demo.bmp
  exit
 }

 demo