Available in the LEADTOOLS Imaging toolkit. |
Acquire Example for Visual Basic
Dim RasterTwain As New LEADRasterTwain_U
Dim
TwainCap As New LEADTwainCapability_U
Dim
CapVal As New LEADRasterVariant_U
Dim
nRet As Integer
RasterTwain.InitSession
hWnd
CapVal.Type
= VALUE_USHORT
CapVal.LongValue
= L_TWSX_FILE
TwainCap.EnableMethodErrors
= False
TwainCap.CapInfo.Capability
= L_ICAP_XFERMECH
TwainCap.CapInfo.ConType
= L_TWON_ONEVALUE
TwainCap.CapOneValue.OneValItemType
= L_TWTY_UINT16
TwainCap.CapOneValue.OneValCapValue
= CapVal
nRet
= RasterTwain.SetCapability2(TwainCap, L_LTWAIN_CAPABILITY_SET)
RasterTwain.FileTransferName
= "c:\twain.bmp"
MsgBox CStr(RasterTwain.MemBufSize)
nRet = RasterTwain.Acquire(L_LTWAIN_SHOW_USER_INTERFACE
If
(nRet <> 0) Then
MsgBox
"Error Acquiring From Source", vbExclamation
End
If