Solved

Acquire image from TWAIN

Posted on 1998-08-06
7
718 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 7

Accepted Solution

by:
psdavis earned 200 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Whenever you post a message, I'll know about it.  No problem!

Phillip
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

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…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

763 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now