小编men*_*ndy的帖子

在 Windows 7 上使用 WIA 扫描多个页面

我正在尝试从进纸器扫描几页,尽管当我调用 ShowTransfer 函数时扫描仪会自动扫描所有页面(不使用循环),但我只返回第一页。

我究竟做错了什么?

这是我的代码:

  WIA.Item item = device.Items[1] as WIA.Item;

            if (pages > 1)
            {
                // Set to feeder
                SetWIAProperty(device.Properties, 44, 1);
            }

            SetWIAProperty(device.Properties, WIA_DEVICE_PROPERTY_PAGES_ID, 1);

            AdjustScannerSettings(item, 150, 0, 0, 1250, 1700, 0, 0, 1);
            try
            {

                // scan image
                WIA.ICommonDialog wiaCommonDialog = new WIA.CommonDialog();
                WIA.ImageFile image = (WIA.ImageFile)wiaCommonDialog.ShowTransfer(item, wiaFormatBMP, false);

                // save to temp file
                string fileName = Path.GetTempFileName();
                File.Delete(fileName);
                image.SaveFile(fileName);
                image = null;
                // add file to output list
                images.Add(Image.FromFile(fileName));
            }
            catch (Exception exc)
            {
                throw exc; …
Run Code Online (Sandbox Code Playgroud)

c# wia scanning windows-7

6
推荐指数
1
解决办法
443
查看次数

标签 统计

c# ×1

scanning ×1

wia ×1

windows-7 ×1