Home › Forums › TWAIN Classic › Getting an image from scanner using twain, c++ programming
- This topic has 2 replies, 2 voices, and was last updated 9 years, 8 months ago by denia.
- AuthorPosts
Hi!
I’m new to twain and these days I’ve been trying to figure out how to write a program in C++ using twain interface to get an image from my scanner.
So I have a canon scanner, and drivers installed for it, I’d like to program the app in visual studio. How to link twain to the scanner? What are the steps I have to take to get this all to work?Howdy…
Your best bet is to download the TWAIN Sample Application from Source Forge.
http://sourceforge.net/projects/twain-samples/If you decide to build it, you’ll need to install QT 4 on your machine. That’s needed for the sample’s user interface, you won’t need it for your project.
The code had a clean separation between the user interface and the TWAIN class. You should be able to move that part of the code to your project. You’ll then have to learn how to make the appropriate calls to control the TWAIN driver. The sample application can provide some guidance, along with the TWAIN Specification.
For comparison, try downloading and running the TWAIN CS project on Source Forge. This project is in C#, but the TWAIN CS Test application can give you insights into the order of the calls you need to make in your application. You can also use the TWACKER (written in C++) as a learning tool, but I recommend against copying its code for use in your application, unless they’re very small snippets…
Good luck!
— Mark
thank you for the help! 😀
- AuthorPosts