|
Available in the LEADTOOLS Imaging toolkit. |
CapArray Example for Visual Basic
Public WithEvents RasterTwain As LEADRasterTwain
Dim TwainCap As LEADTwainCapability
Private Sub Command4_Click()
Dim iRet As Integer
Dim CapVal As New LEADRasterVariant
Set TwainCap = New LEADRasterTwainCapability
TwainCap.CapInfo.ConType = L_TWON_ARRAY
TwainCap.CapInfo.Capability = L_ICAP_FILTER
TwainCap.EnableMethodErrors = False
TwainCap.CapArray.ArrayItemType = L_TWTY_UINT16
TwainCap.CapArray.ArrayNumOfItems = 2
CapVal.Type = VALUE_USHORT
CapVal.LongValue = L_TWFT_RED
TwainCap.CapArray.ArrayCapValue(0) = CapVal
CapVal.Type = VALUE_USHORT
CapVal.LongValue = L_TWFT_GREEN
TwainCap.CapArray.ArrayCapValue(1) = CapVal
iRet = RasterTwain.SetCapability2(TwainCap, L_LTWAIN_CAPABILITY_SET)
If (iRet <> 0) Then
MsgBox "Error Setting Capability"
End If
Set TwainCap = Nothing
End Sub