Wia Scanner

how to use Wia MBS scanner, please some examples of how to do it

That’s a broad question.

You did check the examples coming with MBS Xojo Win Plugin?

Our WIA Scan example project shows how to scan with dialog (“Image Dialog” button) and without dialog ("Take picture button).

Then you can customize it:
You need to set property on the “Feeder” item for “Document Handling Select” property to 4 for duplex.

/*
1 = feeder
2 = flatbed
4 = duplex
8 = front first
16 = back first
32 = front only
64 = back only
128 = next page
256 = preferred
512 = auto advance

see
https://docs.microsoft.com/en-us/windows-hardware/drivers/image/wia-dps-document-handling-select

*/ ]

e.g.

[code]dim it as WIAItemMBS = …
Dim p As WIAPropertyStorageMBS = it.PropertyStorage

p.Write(p. kScannerDevicePropertyDocumentHandlingSelect, 4)[/code]

You can check WIAPropertyStorageMBS class and list all properties to see before/after you changed properties.

and here is a sample output of properties for me:

[quote]{
“Item Name”: “Feeder”,
“Full Item Name”: “0000\\Root\\Feeder”,
“Item Flags”: 532483,
“Color Profile Name”: “sRGB Color Space Profile.icm”,
“Access Rights”: 1,
“Horizontal Optical Resolution”: 1200,
“Vertical Optical Resolution”: 2400,
“Preview”: 0,
“Show preview control”: 1,
“Maximum Horizontal Scan Size”: 8500,
“Maximum Vertical Scan Size”: 14000,
“Sheet Feeder Registration”: 1,
“Minimum Vertical Scan Size”: 1,
“Minimum Horizontal Scan Size”: 0,
“Document Handling Select”: 32,
“Pages”: 0,
“Page Size”: 0,
“Current Intent”: 0,
“Item Category”: “{FE131934-F84C-42AD-8DA4-6129CDDD7288}”,
“Horizontal Resolution”: 200,
“Vertical Resolution”: 200,
“Horizontal Start Position”: 0,
“Vertical Start Position”: 0,
“Horizontal Extent”: 1700,
“Page Width”: 850,
“Vertical Extent”: 2800,
“Page Height”: 1400,
“Rotation”: 0,
“Orientation”: 0,
“DeskewX”: 0,
“DeskewY”: 0,
“Brightness”: 0,
“Contrast”: 0,
“Item Size”: 0,
“Data Type”: 3,
“Bits Per Pixel”: 24,
“Preferred Format”: “{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}”,
“Format”: “{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}”,
“Compression”: 0,
“Photometric Interpretation”: 0,
“Lamp Warm up Time”: 10000,
“Media Type”: 2,
“Channels Per Pixel”: 3,
“Bits Per Channel”: 8,
“Planar”: 0,
“Pixels Per Line”: 1700,
“Number of Lines”: 2800,
“Bytes Per Line”: 0,
“Threshold”: 128,
“Buffer Size”: 131072,
“Filename extension”: “BMP”
}[/quote]