Click or drag to resize

DeviceQueryCapability Method

Determines if a capability is available from the device.

It's unlikely that any one device supports all of the properties and features. You can use this method to find out if a property is get-able and/or set-able. This can also be used to help determine if the device is a camera by checking for camera specific properties, such as FlashUsed or BatteryPercentage.

Namespace:  Atalasoft.Twain
Assembly:  Atalasoft.DotTwain (in Atalasoft.DotTwain.dll) Version: 11.0.0.0.0.297 (.NET 4.5.2, x86)
Syntax
public bool QueryCapability(
	DeviceCapability capability,
	bool canSet
)

Parameters

capability
Type: Atalasoft.TwainDeviceCapability
The capability you want to check.
canSet
Type: SystemBoolean
If true, this method checks to see if this capability can also be set.

Return Value

Type: Boolean
True if the capability is available.
Exceptions
ExceptionCondition
Thrown if a connection to the device is not open.
Examples
QueryCapability (C#)
Device dev = this.acquisition.Devices.Default;
dev.Open();

// See if you can set the Resolution.
bool canSetRes = dev.QueryCapability(DeviceCapability.ResolutionX, true);

dev.Close();
QueryCapability (Visual Basic)
Dim dev As Device =  Me.acquisition.Devices.Default 
dev.Open()

' See if you can set the Resolution.
Dim canSetRes As Boolean =  dev.QueryCapability(DeviceCapability.ResolutionX,True) 

dev.Close()
See Also