public object GetDataSourceCapability(TwIdentity dataSourceId, TwCap capType) { object result = null; TwCapability cap = new TwCapability(capType); if(GetDataSourceCapability(dataSourceId, cap)) { result = cap.GetCurrentValue(); } return result; }
public TwainCapability(TwainDevice twain, TwIdentity dataSourceId, TwCap capType) { fTwain = twain; fDataSourceId = dataSourceId; fCapType = capType; fValueType = TwType.DontCare16; TwCapability cap = new TwCapability(capType); if(fTwain.GetDataSourceAvailableCapabilityValues(dataSourceId, cap)) { fValueType = cap.GetValueType(); Items = new List<object>(); int numItems = cap.GetNumItems(); for(int i = 0; i < numItems; i++) { Items.Add(cap.GetItem(i)); } MinValue = cap.GetMinValue(); MaxValue = cap.GetMaxValue(); StepSize = cap.GetStepSize(); fCurrentValue = cap.GetCurrentValue(); } }