Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
For 2021 - online Python 3 training - see ((here)).

Our plans were to retire in summer 2020 and see the world, but Coronavirus has lead us into a lot of lockdown programming in Python 3 and PHP 7.
We can now offer tailored online training - small groups, real tutors - works really well for groups of 4 to 14 delegates. Anywhere in the world; course language English.

Please ask about private 'maintenance' training for Python 2, Tcl, Perl, PHP, Lua, etc.
Scan an image with TCL/TK code

Posted by kota (kota), 14 April 2004
I have a scanner and i want to control it(get an image)
with TCL/TK code. Is it possible?


Posted by admin (Graham Ellis), 15 April 2004
I'm sure it is, but you might end up embedding Tcl in a C application or embedding C commands within your Tcl - both of which are features that are what Tcl was initially designed for but have become a bit specialist these days.

Another option would be to to use expectk to control an already existing application you might have for the scanner so that you use that application to do the hard work, and Tcl and Tk to provide additional automation and a GUI.

What are you wishing to achieve by scanning from Tcl/Tk?   What drivers / controls do you have already for your scanner?  What operating system are you going to be using?   If you can answer these three questions it'll help you (and us if you post again) fine tune the answer and find which if any routes are worth investigating further.

Posted by kota (kota), 15 April 2004
Thank you very much for spending time to reply!

First of all, i wish to make a scanner work with
TCL/TK or C++. Put an image in the scanner
and save it in a folder.
I think the answer of the drivers is....TWAIN (, i thnk).
I didn't make any drivers, just the authentic(from the cd). The operating system is win98
Sorry if some of the above things, make you nervous


Posted by admin (Graham Ellis), 16 April 2004
I think I would tend to look at spawned / forked processes rather than writing my own driver BUT Windows 98 is really pretty poor at this sort of thing (and I'm not a Win98 expert).  If you've a scanning application that runs from the command line on that CD, you may do better writing a batch file, perhaps with some Tcl control over it.  Expect-based solutions are always a bit flakey on Windows (especially older versions) so that option (the one I would choose on Linux / Unix) is probably out, and I wouldn't want to get involved at a C++ level

This page is a thread posted to the opentalk forum at and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2022: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 793803 • EMAIL: • WEB: • SKYPE: wellho