Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I gone through C# Wia Scanning in WPF application, see the below url:
http://10rem.net/blog/2010/01/08/scanning-images-in-wpf-via-wia

I want to build C# WIA Scanning in WPF application.

- Duplex Scan ( WIA 2.0 ),
- Support all devices ( required Canon ImageFormula DR-130C ),
- Run on 32 and 64bit OS ( eg. Win XP, Vista, 7, 8, 10 etc ).

Please anyone can help me, If you have a sample code for C# WIA scanning with resolve above issues.

I am working with on below environment:
OS: WIndows 8 Pro 64bit
IDE: Visual Studio 2012 Professional
Language: C# 3.5
Framework: 4.5
Library: Windows Image Acquisition or WIA 2.0
Scanner Device: Canon ImageFormula DR-130C

Thanks.
Posted
Updated 16-Nov-15 23:43pm
v3
Comments
Prasad Khandekar 17-Nov-15 4:08am    
Hello Member,

The link already includes the code for sample application.

Regards,
Prasad P. Khandekar
Member 9197067 17-Nov-15 4:14am    
I have a code, but WIA 2.0 is not supported to duplex scanning, not supported to some OS and also some scanner devices.

So I just want to help, Is there is any clue or any pros and cons of WIA 2.0.
Please try to understand me and approve this question.

Thanks.
Member 9197067 17-Nov-15 4:22am    
public ImageFile Scan()
{
ImageFile image;

try
{
CommonDialog dialog = new CommonDialog();

image = dialog.ShowAcquireImage(
WiaDeviceType.ScannerDeviceType,
WiaImageIntent.ColorIntent,
WiaImageBias.MaximizeQuality,
WIA.FormatID.wiaFormatJPEG,
true,
true,
false);

return image;
}
catch (COMException ex)
{
if (ex.ErrorCode == -2145320939)
{
throw new ScannerNotFoundException();
}
else
{
throw new ScannerException("COM Exception", ex);
}
}
}

Before detecting scanner device and after select device from detected device list dialog box getting COM exception. What should I need to do.
Prasad Khandekar 17-Nov-15 4:32am    
Hello,

Check whether the WIA service is running and the PC user has necessary permissions to use a COM component.

Regards,
Prasad P. Khandekar
Member 9197067 17-Nov-15 4:38am    
Yes, WIA service is running on my system, there is no issue. How to give permission to PC user to use a COM component.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900