ScanProperty (Function) In french: ScanPropriété Used to get and change the properties of a scanner.
MyScanner is Scanner // Get the grayscale value // from which a pixel will be converted // to black or white when scanned WIA_IPS_THRESHOLD is int = 6159 Threshold is int = ScanProperty(MyScanner, WIA_IPS_THRESHOLD)
MyScanner is Scanner let ScannerCapability = ScanProperty(MyScanner, scanPropertyCapability) IF ScannerCapability & scanCapabilityFeeder THEN Info("The scanner has a feeder") END IF ScannerCapability & scanCapabilityFlatbed THEN Info("The scanner has a flatbed") END IF ScannerCapability & scanCapabilityDuplex THEN Info("The scanner supports duplex scanning") END
Syntax
Getting the properties of a scanner Hide the details
<Result> = ScanProperty(<Scanner> , <Property>)
<Result>: Type of the property Property value. If an error occurs, the ErrorOccurred variable is set to True and ErrorInfo returns the corresponding error message. <Scanner>: Scanner variable Name of the Scanner variable initialized with the information of the scanner for which we want to get a property. <Property>: Integer Property whose values are requested.
This property can correspond to: - one of the following constants from the WiaDef.h file in the Windows API: WIA_DIP_xxx, WIA_DPA_xxx, WIA_DPS_xxx, WIA_IPA_xxx, or WIA_IPS_xxx.
Caution: The properties supported vary according to the driver used. The list of properties can be found at https://github.com/tpn/winddk-8.1/blob/master/Include/um/WiaDef.h. - one of the following constants:
| | scanPropertyCapability | Scanner capability. In this case, <Result> can be any combination of the following constants: - scanCapabilityFeeder: The scanner has a feeder.
- scanCapabilityFlatbed: The scanner has a flatbed.
- scanCapabilityDuplex: The scanner supports duplex scanning.
| scanPropertyPaperSize | Page size currently set for scanning. In this case, <Result> can be one of the following constants: | | - scanPaperSizeA0
- scanPaperSizeA1
- scanPaperSizeA10
- scanPaperSizeA2
- scanPaperSizeA3
- scanPaperSizeA4
- scanPaperSizeA5
- scanPaperSizeA6
- scanPaperSizeA7
- scanPaperSizeA8
- scanPaperSizeA9
- scanPaperSizeAuto
- scanPaperSizeB0
- scanPaperSizeB1
- scanPaperSizeB10
- scanPaperSizeB2
- scanPaperSizeB3
- scanPaperSizeB4
- scanPaperSizeB5
- scanPaperSizeB6
- scanPaperSizeB7
- scanPaperSizeB8
- scanPaperSizeB9
- scanPaperSizeC0
- scanPaperSizeC1
- scanPaperSizeC10
- scanPaperSizeC2
- scanPaperSizeC3
| - scanPaperSizeC4
- scanPaperSizeC5
- scanPaperSizeC6
- scanPaperSizeC7
- scanPaperSizeC8
- scanPaperSizeC9
- scanPaperSizeBusinessCard
- scanPaperSizeStatement
- scanPaperSizeDINB2
- scanPaperSizeDINB4
- scanPaperSizeLedger
- scanPaperSizeJISA2
- scanPaperSizeJISA4
- scanPaperSizeJISB0
- scanPaperSizeJISB1
- scanPaperSizeJISB10
- scanPaperSizeJISB2
- scanPaperSizeJISB3
- scanPaperSizeJISB4
- scanPaperSizeJISB5
- scanPaperSizeJISB6
- scanPaperSizeJISB7
- scanPaperSizeJISB8
- scanPaperSizeJISB9
- scanPaperSizeLegal
- scanPaperSizeLetter
- scanPaperSizeCustom
| Remark: If the scanPaperSizeCustom constant is used, the dimensions must be specified in the Area property of the variable of type Scanner. |
Changing the properties of a scanner Hide the details
<Result> = ScanProperty(<Scanner> , <Property> , <Value>)
<Result>: Boolean - True if the property was modified,
- False otherwise.
If an error occurs, the ErrorOccurred variable is set to True and ErrorInfo returns the corresponding error message.
<Scanner>: Scanner variable Name of the Scanner variable initialized with the information of the scanner for which we want to change a property. <Property>: Integer Property whose value is to be changed. This property can correspond to: - one of the following constants from the WiaDef.h file in the Windows API: WIA_DIP_xxx, WIA_DPA_xxx, WIA_DPS_xxx, WIA_IPA_xxx, or WIA_IPS_xxx.
Caution: The properties supported vary according to the driver used. The list of properties can be found at https://github.com/tpn/winddk-8.1/blob/master/Include/um/WiaDef.h. - one of the following constants:
| | scanPropertyCapability | Scanner capability. In this case, <Result> can be any combination of the following constants: - scanCapabilityFeeder: The scanner has a feeder.
- scanCapabilityFlatbed: The scanner has a flatbed.
- scanCapabilityDuplex: The scanner supports duplex scanning.
| scanPropertyPaperSize | Page size currently set for scanning. In this case, <Result> can be one of the following constants: | | - scanPaperSizeA0
- scanPaperSizeA1
- scanPaperSizeA10
- scanPaperSizeA2
- scanPaperSizeA3
- scanPaperSizeA4
- scanPaperSizeA5
- scanPaperSizeA6
- scanPaperSizeA7
- scanPaperSizeA8
- scanPaperSizeA9
- scanPaperSizeAuto
- scanPaperSizeB0
- scanPaperSizeB1
- scanPaperSizeB10
- scanPaperSizeB2
- scanPaperSizeB3
- scanPaperSizeB4
- scanPaperSizeB5
- scanPaperSizeB6
- scanPaperSizeB7
- scanPaperSizeB8
- scanPaperSizeB9
- scanPaperSizeC0
- scanPaperSizeC1
- scanPaperSizeC10
- scanPaperSizeC2
- scanPaperSizeC3
| - scanPaperSizeC4
- scanPaperSizeC5
- scanPaperSizeC6
- scanPaperSizeC7
- scanPaperSizeC8
- scanPaperSizeC9
- scanPaperSizeBusinessCard
- scanPaperSizeStatement
- scanPaperSizeDINB2
- scanPaperSizeDINB4
- scanPaperSizeLedger
- scanPaperSizeJISA2
- scanPaperSizeJISA4
- scanPaperSizeJISB0
- scanPaperSizeJISB1
- scanPaperSizeJISB10
- scanPaperSizeJISB2
- scanPaperSizeJISB3
- scanPaperSizeJISB4
- scanPaperSizeJISB5
- scanPaperSizeJISB6
- scanPaperSizeJISB7
- scanPaperSizeJISB8
- scanPaperSizeJISB9
- scanPaperSizeLegal
- scanPaperSizeLetter
- scanPaperSizeCustom
| Remark: If the scanPaperSizeCustom constant is used, the dimensions must be specified in the Area property of the variable of type Scanner. |
<Value>: Type corresponding to the property New value for the property. Business / UI classification: UI Code
This page is also available for…
|
|
|
|