set_SaneResolution Method
In This Topic
Sets image resolution of SANE device.
Syntax
var instance = new Vintasoft.Twain.WebTwainDeviceJS(deviceName, productFamily, manufacturer, driverVersion, twainVersion, deviceManager, is64Bit);
var returnValue; // Type: any
// Parameters
var value; // Type: number
returnValue = instance.set_SaneResolution(value);
function set_SaneResolution(
: number
) : any;
Parameters
- value
- Resolution.
Exceptions
Exception | Description |
| Thrown if device is not opened OR error occurs during setting value of device capability. |
Example
// Sets scan resolution of opened SANE device.
function setSaneScanResolution(saneDevice) {
try {
console.log("SANE device: " + saneDevice.get_DeviceName());
// if SANE device is not opened
if (!saneDevice.get_IsOpened()) {
console.log("Device is not opened. Please open device.");
return;
}
// set 300 dpi resolution for SANE device
saneDevice.set_SaneResolution(300);
console.log("Scan resolution: " + saneDevice.get_SaneResolution());
}
catch (ex) {
alert(ex);
}
}
Browser Compatibility
See Also