View previous topic :: View next topic |
Author |
Message |
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 17, 2010 12:30 am Post subject: Use scanner Help [SOLVED] |
|
|
Hi to all
I need to use a scanner to acquire image in a my script, it's possible connect to Twain and use it ? How?
Many tnx
Last edited by Tdk161 on Sat Aug 28, 2010 2:19 pm; edited 1 time in total |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Tue Aug 17, 2010 1:48 pm Post subject: |
|
|
I think there was a version of VDSDLL that had this ability??? It may be a module? _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 17, 2010 3:31 pm Post subject: |
|
|
Hi vdsalchemist,
I don't know but I will controll VdsDll,
Thanks for your info
Byez |
|
Back to top |
|
|
Aslan Valued Contributor
Joined: 31 May 2001 Posts: 589 Location: Memphis, TN USA
|
Posted: Wed Aug 18, 2010 1:51 am Post subject: |
|
|
The only scanner type option in the VDSDLL is for barcode reading. |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Aug 18, 2010 5:10 am Post subject: |
|
|
Thank's Aslan
I thinked to to connect to Windows Api using GadgetX.dll,if possible but I don't know how .
Any suggestion? |
|
Back to top |
|
|
Rubes_sw Valued Contributor
Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Aug 18, 2010 7:47 am Post subject: |
|
|
Hi
I'm nearly sure I have a vds all called vdstwain.dll, I'll check when I get into the office, not sure it will work with vds5,6
Nathan |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Aug 18, 2010 7:54 am Post subject: |
|
|
Many tnx Nathan,, I wait hoping you will found it
Byez |
|
Back to top |
|
|
Rubes_sw Valued Contributor
Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Aug 18, 2010 8:58 am Post subject: |
|
|
Here ya go.... ( enjoy )
The source code for the dll is included....
The dll was created on the 28th June 2001
- Created with Delphi 4
Download from:
http://80.76.205.33/files/vds/vdstwain.zip
So there is no details on who created it... ;-(
Hopefully it works for ya...
Nathan |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Wed Aug 18, 2010 9:25 am Post subject: |
|
|
Hi Nathan,
thank you very much, I downloaded it and triyed but not work, maybe on last O.S. not work
I will search some Delphi programmer to correct it.......hoping to found
Thank's again
Byez |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Tue Aug 24, 2010 12:10 pm Post subject: |
|
|
Hi Vds people
there is a Delphi programmer wold like (and have time to spend) to correct thie VdsTwain dll to be able to work fine with Vds6 and latest version of windows?
Unfortunatly I searched Delphi programmer to make it without found
and I don't know delphi language to correct myself the dll code
VdsTwain Download Link:
Code: | http://www.mediafire.com/?7ro3qm4nc7j9443 |
Many tnx for any info or Help
Byez |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Aug 27, 2010 8:56 pm Post subject: |
|
|
Tdk161, Well from what I can tell from the source that is included with the dll it used a product called EZTwain. This brings back memories so I did some googling and found that if you go here http://www.dosadi.com/eztwain1.htm you can download a DLL called eztw32.dll... If you can get that DLL then to do what the vdstwain.dll does you only need to do 2 functions to acquire an image from the scanner... I could be wrong because I have not messed with this stuff in a very long time.
Code: |
Title Test EZTwain
#define command,TWAIN_Acquire
TWAIN_Acquire @Path(%0)test.bmp
stop
:TWAIN_Acquire
LoadLib eztw32.dll
# %1 is the path and name of the file to save the scanned image to
%A = %1
%R = @lib(eztw32,TWAIN_SelectImageSource,INT:,INT:0)
%R = @lib(eztw32,TWAIN_AcquireToFilename,INT:,INT:0,INT:@Addr("%A"))
FreeLib eztw32
Exit
|
Have fun _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Fri Aug 27, 2010 10:04 pm Post subject: |
|
|
vdsalchemist
WORK!!!!!!!!!!!
I don't know how to tell you thank
you resolved a my big big trouble |
|
Back to top |
|
|
vdsalchemist Admin Team
Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Sat Aug 28, 2010 12:04 pm Post subject: |
|
|
You are very welcome If I had more time I would wrap this DLL and build us a nice little DSU but for now that should do much of what one would want to do with a scanner. _________________ Home of
Give VDS a new purpose!
|
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sat Aug 28, 2010 12:55 pm Post subject: |
|
|
Hi
I writed this little dsu for my script to use scanner with your routine
Code: | #Define Command,Acquire
# Sintax:
# Acquire [Path\Filename.bmp),[optional] 0
# 1 to show error description
#
#@Ok()= True if operation Success
#
# Usage Example:
#
#Acquire Image.bmp
#If @Not(@Ok())
# Warn Error
#End
#
#stop
:Acquire
If @Not(@File(eztw32.dll))
If %2
Warn External Library Eztw32.dll Not Found! @Cr()Execution Stopped
End
Error -1
Exit
End
If @Not(%1)
If %2
Warn Missing destination file@Cr()Sintax: Acquire [Path]\Filename.Bmp
End
Error -1
Exit
End
LoadLib eztw32.dll
%A = %1
%R = @Lib(eztw32,TWAIN_SelectImageSource,INT:,INT:0)
If %r
Error -1
End
%R = @Lib(eztw32,TWAIN_AcquireToFilename,INT:,INT:0,INT:@Addr("%A"))
If %r
error -1
End
FreeLib eztw32 .dll
Exit
|
I know it's very stupid dsu
Thank you again
Last edited by Tdk161 on Sun Aug 29, 2010 12:51 am; edited 1 time in total |
|
Back to top |
|
|
Tdk161 Valued Contributor
Joined: 08 Feb 2005 Posts: 399 Location: ITALY
|
Posted: Sat Aug 28, 2010 3:38 pm Post subject: |
|
|
I changed little bit the Dsu
Code: | Title Aquire from scanner
#Define Command,Acquire
:Acquire
If @Null(@Ext(%1))
%i = %1.bmp
ElsIf @UnEqual(@Ext(%1),BMP)
%I = @Path(%1)Temp.BMP
%o = %1
Elsif @Equal(@Ext(%1),BMP)
%i = %1
End
If @Not(@File(eztw32.dll))
Error -75
Exit
End
If @Not(%1)
Error -76
Exit
End
LoadLib eztw32.dll
%R = @Lib(eztw32,TWAIN_SelectImageSource,INT:,INT:0)
If @Zero(%r)
Error -1
Exit
End
%R = @Lib(eztw32,TWAIN_AcquireToFilename,INT:,INT:0,INT:@Addr("%i"))
If @Zero(%r)
error -1
Exit
End
FreeLib eztw32 .dll
If @Both(@Zero(%r),@File(VdsConv.Dll))
External VdsConv.dll
#Define Command,Convert
If @Equal(@Ext(%o),GIF)
convert bmp2Gif,%I,%o
ElsIf @Equal(@Ext(%o),JPG)
convert bmp2jpg,%I,%o
End
If @File(Temp.bmp)
File Delete,Temp.bmp
End
End
Exit
|
Now if Is present Vdsconv.dll the dsu convert automaticaly into format .JPG or .GIF, if the extension of filename passed is one of this
Enjoy
***************
Correct code to stop process if Cancel Button on select source dialog is pressed
************** |
|
Back to top |
|
|
|