Acquire Example for Visual Basic

Dim RasterTwain As New LEADRasterTwain_U
Dim nRet As Integer

RasterTwain.InitSession hWnd
RasterTwain.SelectSource
RasterTwain.GetProperties
RasterTwain.DataTransfer.TransferMode = L_TWSX_FILE
RasterTwain.DataTransfer.ScanFileFormat = L_TWFF_JFIF
RasterTwain.FileTransferName = "c:\test.jpg"
MsgBox "Buffer Size = " + CStr(RasterTwain.MemBufSize)
RasterTwain.SetProperties
nRet = RasterTwain.Acquire(L_LTWAIN_SHOW_USER_INTERFACE)
If (nRet <> 0) Then
	MsgBox "Error Acquiring From Source", vbExclamation
End If