• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 746
  • Last Modified:

Acquire image from TWAIN

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
mrbird
Asked:
mrbird
  • 4
  • 3
1 Solution
 
psdavisCommented:
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
 
psdavisCommented:
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
 
mrbirdAuthor Commented:
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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
psdavisCommented:
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
 
mrbirdAuthor Commented:
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
 
mrbirdAuthor Commented:
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
 
psdavisCommented:
Whenever you post a message, I'll know about it.  No problem!

Phillip
0

Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now