我有一台使用 WIA 2.0 连接的名片扫描仪。我试图在代码中设置所有内容,这样我就不必弹出任何对话框。我遇到的问题与设置扫描页面大小有关。扫描仪大约有 4 英寸宽,但我无法让它扫描床最右边的一英寸左右。我会设置 PAGE_SIZE 属性,但在遍历 WIA 的所有属性时我看不到该属性该扫描仪(设备或项目属性)。
如果我弹出一个对话框 (ShowSelectDialog) 来选择大小,一切似乎都正常。我已经比较了该对话框之前和之后 Item 和 Device 的属性,根据 MSDN,我看到唯一改变的属性是只读属性。 (水平和垂直尺寸、范围、起始位置)
关于我还能如何修改页面大小的任何想法?
最佳答案
您可以尝试在 Item 属性上设置值,例如
double _width = 2; //two inches
double _height = 2; //two inches
dynamic item = device.Items[1]; // get the first item
int dpi = 150;
item.Properties["6146"].Value = 2; //greyscale
item.Properties["6147"].Value = dpi;
item.Properties["6148"].Value = dpi;
item.Properties["6151"].Value = (int)(dpi * _width);
item.Properties["6152"].Value = (int)(dpi * _height);
当我需要扫描 A3 纸时,这对我很有用。
关于c# - 在 WIA 2.0 中扫描时设置页面大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3603063/