CapRange Example for Visual Basic
Public WithEvents RasterTwain As LEADRasterTwain
Dim TwainCap As LEADTwainCapability
Private Sub Command5_Click()
Dim iRet As Integer
Dim CapVal As New LEADRasterVariant
Set TwainCap = New LEADRasterTwainCapability
TwainCap.CapInfo.ConType = L_TWON_RANGE
TwainCap.CapInfo.Capability = L_ICAP_JPEGQUALITY
TwainCap.EnableMethodErrors = False
TwainCap.CapRange.RangeItemType = L_TWTY_INT16
CapVal.Type = VALUE_SHORT
CapVal.ShortValue = L_TWJQ_MEDIUM
TwainCap.CapRange.RangeCurrentValue = CapVal
CapVal.Type = VALUE_SHORT
CapVal.ShortValue = L_TWJQ_HIGH
TwainCap.CapRange.RangeDefaultValue = CapVal
CapVal.Type = VALUE_SHORT
CapVal.ShortValue =0
TwainCap.CapRange.RangeMinimumValue = CapVal
CapVal.Type = VALUE_SHORT
CapVal.ShortValue =50
TwainCap.CapRange.RangeMaximumValue = CapVal
CapVal.Type = VALUE_SHORT
CapVal.ShortValue = 10
TwainCap.CapRange.RangeStepSize = CapVal
iRet = RasterTwain.SetCapability2(TwainCap, L_LTWAIN_CAPABILITY_SET)
If (iRet <> 0) Then
MsgBox "Error Setting Capability"
End If
Set TwainCap = Nothing
End Sub