Call TWAIN functions from WIA driver

995 views Asked by At

I have a scanner that has a a TWAIN driver. As you may know, TWAIN devices are not recognized by Windows Device Manager as image devices, so in order to make it visible as an image device I need to develop a WIA driver. Is there any way I can call the TWAIN functions from the WIA driver or should I do it from scratch?

I tried to include the dlls for a TWAIN API (Image Gear) to call the TWAIN functions from my WIA driver (to use it as a bridge between the WIA driver and the device), but that didn't work.

Sorry if this is a dumb question, but I'm new to driver development.

2

There are 2 answers

0
Mike Kaganski On

WIA on TWAIN from TWAIN working group:

A WIA on TWAIN driver implementation designed to expose all necessary scanner functionality while adhering to the WIA 1.0 and WIA 2.0 specification and achieving compatibility with all WIA compliant applications.

Features

• Uses existing TWAIN datasource to communicate with scanner

• Uses a MSVC wizard to generate the WIA driver

• One binary for both WIA 1.0 and WIA 2.0

• A Programmatic WIA interface that provides minimum operation required for obtaining Windows Logo.

• Supports flatbed, ADF, and combo scanners

0
Preeth Pratheek On

Twain and WIA are different on several levels. The way they interact with the application, maintain data (scan parameters, image data etc..). That said there are some common functionalities as well. Eg: 1) the way your driver communicates with the device i.e the network layer code can be the same that can be reused. 2) Implementation of features for TWAIN driver for image enhancements can be reused in WIA drivers.

So, my suggestion would be: 1)pick up the sample driver in the WDK provided and get hold of how WIA works. 2)append the communication layer from TWAIN driver and get a working driver. 3)upon scanning your first image use enhancements/processing of raster data you already have with your TWAIN driver.