HOME

&& Acquire an image from twain device with Visual Foxpro and GdPicture Pro Imaging SDK
&& Download the last version of GdPicture Pro Imaging SDK at http://www.gdpicture.com/download.php



LOCAL Imaging
Imaging = CREATEOBJECT("gdpicturepro5.Imaging")
Imaging.SetLicenseNumber("0012345678910111213141516")
Imaging.TwainOpenDefaultSource() && You need to call this function before each scan process
Imaging.TwainSetHideUI(.T.) && To deactive the user interface
Imaging.TwainSetCurrentResolution(200) && To scan in 200 DPI
Imaging.TwainSetCurrentPixelType(2) && RGB
Imaging.TwainSetCurrentBitDepth(8) && 24 BPP
Imaging.TwainSetPaperSize(1) && A4 format
IF Imaging.CreateImageFromTwain(application.hWnd) = 0 then
Imaging.SaveAsJpeg("c:\testtwain.jpg", 90)
Imaging.CloseNativeImage()
MESSAGEBOX("File saved as c:testtwain.jpg !")
ELSE
MESSAGEBOX("Error appened !")
ENDIF
Imaging.TwainCloseSource()
RELEASE Imaging