FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to access a scanner via TWAIN.
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
How to access a scanner via TWAIN.
Posted: Mon May 21, 2012 05:05 AM

Anybody have any recommendations for accessing a scanner via TWAIN with FiveWin?

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Mon May 21, 2012 08:11 AM

I'm using eztw32.dll.

EMG

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to access a scanner via TWAIN.
Posted: Mon May 21, 2012 10:05 AM

Thank you, any examples in FiveWin?

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Mon May 21, 2012 01:01 PM
Code (fw): Select all Collapse
    IF TWAIN_ISAVAILABLE() = 0
        ? "Twain not available"
        RETURN NIL
    ENDIF

    IF TWAIN_ACQUIRETOFILENAME( 0, cBmp ) != 0
        ? "Error while scanning"
        RETURN NIL
    ENDIF

    IF !SAVEIMG( cBmp, cJpg, 2, 80 )
        ? "Error while converting to BMP"
        RETURN NIL
    ENDIF


DLL STATIC FUNCTION TWAIN_ACQUIRETOFILENAME( hWnd AS LONG, cFile AS LPSTR ) AS LONG;
    PASCAL FROM "TWAIN_AcquireToFilename" LIB "eztw32.dll"

DLL STATIC FUNCTION TWAIN_ISAVAILABLE() AS LONG;
    PASCAL FROM "TWAIN_IsAvailable" LIB "eztw32.dll"


EMG
Posts: 150
Joined: Tue Jul 15, 2008 07:12 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 12:36 PM

Search TScan32 by Rafa Carmona

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 02:20 PM

Is there a lib that works with xHarbour?

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 150
Joined: Tue Jul 15, 2008 07:12 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 02:31 PM
Posts: 150
Joined: Tue Jul 15, 2008 07:12 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 02:35 PM

i´m using with

Fwh 1101
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6717)

works fine

http://www.fivetechsoft.com/files/utilities/tscan32.zip

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 02:36 PM

Rapidshare:

The following download is not available:

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 02:47 PM

Byron, did you try my sample?

EMG

Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 03:04 PM

Yes I made a quick attempt, but I could not get it to link.

Where do I find SaveImg(), is this Harbour, Fivewin, or from the DLL.
If it is from the DLL do I need to create a declare statement for it as well.

My xHarbour is kind of old: (like me)
xHarbour Compiler build 0.99.61 (SimpLex)

My FiveWin:
7.01

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 150
Joined: Tue Jul 15, 2008 07:12 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 04:46 PM
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 05:40 PM
byron.hopp wrote:Yes I made a quick attempt, but I could not get it to link.

Where do I find SaveImg(), is this Harbour, Fivewin, or from the DLL.
If it is from the DLL do I need to create a declare statement for it as well.

My xHarbour is kind of old: (like me)
xHarbour Compiler build 0.99.61 (SimpLex)

My FiveWin:
7.01


Please try without SaveImg(). If you are really interested I will post the function here.

EMG
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 08:45 PM

Works without SaveImg().
Is there more functionality of the EzTw32.dll.
Like x and y resolution and so one.
do you possibility have a prg with all of the "DLL Static Function" declare statements?
It seems there should be a way to hide the UI of the twain provider, and set the resolution.

No matter what, it works, thanks...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: How to access a scanner via TWAIN.
Posted: Wed May 23, 2012 08:49 PM
You might try this example application.
You might need to create your own import .lib
http://code.google.com/p/fivewin-contributions/downloads/detail?name=testscancomplete.zip&can=2&q=