AcquireMulti Example for Visual FoxPro 6

#define L_LTWAIN_SHOW_USER_INTERFACE 1
#define L_LTWAIN_BUFFER_MODE 2
#define FILE_TIF 3

oRasterTwain.FastTransferMode = L_LTWAIN_BUFFER_MODE
oRasterTwain.FastFormat = FILE_TIF
oRasterTwain.FastBitsPerPixel = 1
oRasterTwain.FastBufferSize = 0
oRasterTwain.FastUsePreferredBufferSize = .T.
oRasterTwain.EnableAcquireMultiEvent = .T.

nRet = oRasterTwain.AcquireMulti("c:\Twain\test.tif", L_LTWAIN_SHOW_USER_INTERFACE, .T.)

If nRet = 0 Then
   MessageBox("The Fast Twain method was successful")
Else
   MessageBox("Error occurred during the fast Twain method!!!")
EndIf

 

For details about implementing the event, see the tutorial Acquiring an Image.

 

PROCEDURE AcquireMultiEvent(nPage, bstrFileName, bFinishScan)
   If bFinishScan Then
      strMsg = "The page # " + Str(nPage) + " is scanned and saved to file name " + bstrFileName
      MessageBox(strMsg)
EndIf   
ENDPROC