HOME

&& Acquire multiple images from the document feeder of a twain device with Visual Foxpro and GdTwain Pro SDK
&& Download the last version of GdTwain Pro SDK at http://www.gdpicture.com/download.php


PRIVATE oTwain,; nCpt oTwain = CREATEOBJECT("gdtwainpro2.twain") nCpt = 0 WITH oTwain as gdtwainpro.twain &&Open the source IF .TwainOpenDefaultSource() .SetLicenseNumber("0012345678910111213141516")
.TwainOpenDefaultSource() && You need to call this function before each scan process
.TwainSetHideUI(.T.) && To deactive the user interface
.TwainSetCurrentResolution(200) && To scan in 200 DPI
.TwainSetCurrentPixelType(2) && RGB
.TwainSetCurrentBitDepth(8) && 24 BPP
.TwainSetPaperSize(1) && A4 format .TwainSetAutoFeed(.T.) .TwainSetAutoScan(.T.) &&Acquire and Save DO WHILE .TwainAcquireToGdPictureImage != 0 nCpt = nCpt + 1 nImageID = .GetNativeImage .SaveAsJpeg("c:\image" + ALLTRIM(STR(nCpt)) + ".jpg") .CloseImage(nImageID) ENDDO &&Close the source .TwainCloseSource ELSE MESSAGEBOX("Can't open default source") ENDIF ENDWITH
RELEASE oTwain