Solved

Acquire image from TWAIN

Posted on 1998-08-06
7
721 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

828 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