Home › Forums › TWAIN Classic › Developing TWAIN driver
- This topic has 19 replies, 8 voices, and was last updated 1 year ago by Mark.
- AuthorPosts
Hello,
I’m beginner at TWAIN driver.
Our software interface with digital sensor and acquire image using API function manufacturer provides.
I want to make TWAIN driver with this API so that any imaging software which support TWAIN interface can acquire image from the sensor.
Can I get TWAIN driver sample source code?
Can I develop with C#?
I need any advice which can be help.Thanks in advance.
Hello:
Please see information on the self-certification process at:
http://twain.org/scannerdriverdevelopers/self-certification-process.html
In my case, The Source is the object of development among the Application, The Source Manager and The Source, is it right?
In the 2-4 State Transition Diagram of the TWAIN Specification 2.2, there are 7 steps like following.
1 : Pre-Session
2 : Source Manager Loaded
3 : Source Manager Opened
4 : Source Open
5 : Transfer Ready
6 : Source Enabled
7 : Source OpenI need sample source code regarding 4~7.
Can you let me know the location I can download it?The TWAIN Working Group maintains open source sample code (BSD license) for both TWAIN applications and TWAIN drivers (data sources) at the following location:
http://sourceforge.net/projects/twain-samples/The sample driver simulates a scanner, generating its own images. You should be able to find the functions where it does this and insert the calls to your device’s API in roughly the same place.
The TWAIN Specification fully details all of the things that a driver needs to do:
http://twain.org/scannerdriverdevelopers/specification-and-tools.htmlAs for writing the driver in C#, that’s unusual, but not impossible to do. The Data Source Manager looks for a C-style entry point named DS_Entry (the definition is in the Spec and the TWAIN.H file). Once you get past that you can use whatever language you want. However, the sample code is written in C++, so you’ll have a fair amount of work moving all of that code to C#.
You can get a bit of help from this open source project:
http://sourceforge.net/projects/twainforcsharp/This code shows how to write applications for TWAIN using C#, and includes a complete TWAINH.CS file, that matches all of the content of the TWAIN 2.3 TWAIN.H file put out by the TWAIN Working Group. I’m not sure how well it will apply to development work on the driver side, but it’s a start.
Myself, I would stick with the C++ code, because then bug fixes and new functionality put out by the TWAIN Working Group will be easy to adopt. But that’s just my opinion… 🙂
@MarkM wrote:
The TWAIN Working Group maintains open source sample code (BSD license) for both TWAIN applications and TWAIN drivers (data sources) at the following location:
http://sourceforge.net/projects/twain-samples/I downloaded twainds.source.2.1.3.zip, unzipped, opened Twain_DS_sample01visual_studioTWAINDS_VS2008.sln and it was converted to Visual Studio 2010(My Visual Studio version is 2010)
Compiled it but compile error occurs like attached screen capture.
How could I fix this error?I’m trying compiling with Visual Studio2010 but error occurs.
Can anybody who have tried with Visual Studio 2010 give me any idea about this?Can you share the errors you’re seeing?
Here is the screen capture.
I tried VS2008 Express as well but the same error occurs at moc_QT* under GeneratedFiles.If you look in the readme.txt file you should find the following instructions…
[Windows]
– install QT 4.5.3 SDK for windows
– Set environment variable QTDIR and/or QTDIR_64 to qt directory (Ex. QTDIR=C:Qt2009.02qt QTDIR_64=C:Qt2009.02_x64qt)
– QMake is used to generate the makefiles. You can get a copy of this free in any
QT Open Source distribution. Please see http://www.trolltech.com for more info.
– copy the TWAIN_logo.png and TWAINDS_Sample[32|64].ds to /Windows/twain_[32|64]/sample2
directory.
– Or use the provided Visual Studio project files.After you do that the project should build for you…
Should I install QT 4.5.3 SDK even though I use Visual Studio 2010?
If I see the instruction,– install QT 4.5.3 SDK for windows
………
– Or use the provided Visual Studio project files.QT or VS is preference. Isn’t it?
To make same environment, I installed Visual Studio 2008 and QT 4.5.3 but I have no idea of how to change the environment.
Can anybody let me know more detailed information?Hello,
I am having the same issue and confusion. Can anyone give some guidance?
Thank you,
Matt
I am also having the same issue. Any help for us would be greatly appreciated.
Hello:
Please see information on the self-certification process at
Gclub
Try use Saraff.Twain.DS (https://twainds.codeplex.com/).
Saraff.Twain.DS is the skillful class library which allows you to design drivers (a Data Source) of flatbed scanner, web and digital camera and any other TWAIN device from .NET environment. You can use this library in your programs written in any programming languages compatible with .NET technology (C#, VB.NET).Charlie LiuDear Sir/ madam,
We are manufacturer of oral camera and some other related ODM products. From our clients inquiry, our UVC camera shall have to be recognized by their TWAIN system where installed to my client’s PC. Is it possible for us to get any licensed source code at device side or any vailed open source code/ SDK from TWAIN?
Sincerely, Charlie- AuthorPosts