Solved

Acquire image from TWAIN

Posted on 1998-08-06
7
719 Views
Last Modified: 2008-02-01
I'm using BC++ Builder3. I try to select source and acquire image from scanner using twain_32.dll, twain32.lib and twain.h - But when I open Source Manager, it can not find any device (but other program did) and when I acquire image it also can not find any devices (Unable to open default data source).

How to solve this or are there other easier ways to access scanner? (using Library or Component) and I would like to control the size of image, bit depth, dpi from my application with out showing the Scanner UserInterface.
0
Comment
Question by:mrbird
  • 4
  • 3
7 Comments
 
LVL 7

Expert Comment

by:psdavis
ID: 1169581
Try looking at www.twain.org.  You'll find a class library with source code there called CTwain.  It should provide you with the basics on using the twain libraries to acquire the image.  There is also Twack and full source code support.

Good luck.  Everything you'll need for C or MFC twain support is posted there on a regular basis.  If you need more, comment me back and I'll give you more.

Phillip
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1169582
You will also see complete documentation (in Word format) about code "triplets". This will allow you to change your dpi, image type, etc. (exactly what you're looking for) without the user interface pop up.  I've completely rewritten the twain interface for MFC, but it won't do you much good in BC.

Phillip
0
 

Author Comment

by:mrbird
ID: 1169583
Thank you for your answer Phillip, but I still have a question.
I try to look at Eztwain library and I do the same as it does (copy the code into my program), but it doesn't work. I can not open the default source. But when I load Eztwain library to my program it work but there are many limitation.
Do you think CTwain/Twack can solve this?
CTwain and Twack, which one is better?

Sorry I'm very new with this kind of thing, I will get it very slow.

Thank you :)
bird
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 7

Accepted Solution

by:
psdavis earned 200 total points
ID: 1169584
Work with twack since it is in C and not in MFC.  CTwain is purely MFC but it's very good.  

The first question is: Can you get twack to work with your default source?  If so, then the problem is going to be the organization of the twain commands.  They're difficult to get exactly right, but once done, they're fairly well set.  

If you can go MFC, then definitely go CTwain, it's already got most of the organization done for you.  It's more of a plug in at that point.

The twack shouldn't have any limitations, everything is allowed.  If you want to test the triplets, I believe there's even source code for them to assist you.  Now remember, that not all sources (such as Canon scanners) support most of the triplets.

Phillip

0
 

Author Comment

by:mrbird
ID: 1169585
Thank you for you help, I will try Twack.
Please re-check this page on monday, may be I will put the question (if any) here.

bird
0
 

Author Comment

by:mrbird
ID: 1169586
Thank you for you help, I will try Twack.
Please re-check this page on monday, may be I will put the question (if any) here.

bird
0
 
LVL 7

Expert Comment

by:psdavis
ID: 1169587
Whenever you post a message, I'll know about it.  No problem!

Phillip
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question