在WIA 2.0中扫描时设置页面大小

时间:2010-08-30 18:18:27

标签: c# wia

我有一个名片扫描仪我正在使用WIA 2.0进行交互。我正在尝试在代码中设置所有内容,以便我不必弹出任何对话框。我遇到的问题与设置扫描页面大小有关。扫描仪的宽度约为4英寸,但我不能让它扫描最右边的英寸左右。我会设置PAGE_SIZE属性但是在迭代WIA所有属性时我看不到该属性扫描仪(设备或项目属性)。

如果我弹出一个对话框( ShowSelectDialog )来选择大小,一切似乎都可以正常工作。我在该对话框之前和之后比较了项目和设备上的属性,我看到的唯一属性是根据MSDN的只读属性。 (水平和垂直尺寸,范围,起始位置)

关于我如何修改页面大小的任何想法?

1 个答案:

答案 0 :(得分:0)

您可以尝试在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纸张时,这对我有用。

相关问题