Page 1 of 2

How to access a scanner via TWAIN.

PostPosted: Mon May 21, 2012 5:05 am
by byron.hopp
Anybody have any recommendations for accessing a scanner via TWAIN with FiveWin?

Re: How to access a scanner via TWAIN.

PostPosted: Mon May 21, 2012 8:11 am
by Enrico Maria Giordano
I'm using eztw32.dll.

EMG

Re: How to access a scanner via TWAIN.

PostPosted: Mon May 21, 2012 10:05 am
by byron.hopp
Thank you, any examples in FiveWin?

Re: How to access a scanner via TWAIN.

PostPosted: Mon May 21, 2012 1:01 pm
by Enrico Maria Giordano
Code: Select all  Expand view
   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

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 12:36 pm
by postinelli
Search TScan32 by Rafa Carmona

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 2:20 pm
by byron.hopp
Is there a lib that works with xHarbour?

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 2:31 pm
by postinelli

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 2:35 pm
by postinelli
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

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 2:36 pm
by byron.hopp
Rapidshare:

The following download is not available:

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 2:47 pm
by Enrico Maria Giordano
Byron, did you try my sample?

EMG

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 3:04 pm
by byron.hopp
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

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 4:46 pm
by postinelli

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 5:40 pm
by Enrico Maria Giordano
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

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 8:45 pm
by byron.hopp
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...

Re: How to access a scanner via TWAIN.

PostPosted: Wed May 23, 2012 8:49 pm
by Gale FORd
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=