?
Solved

Acquire image from TWAIN

Posted on 1998-08-06
7
Medium Priority
?
732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 7

Accepted Solution

by:
psdavis earned 800 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
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…

718 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