wia

WIA scanning in a WPF application

谁说我不能喝 提交于 2019-12-11 10:43:44
问题 I'm using WIA 2.0 to scan images from a HP scanner. The problem is that saved TIFFs are around 9MBs big (A4 page at 300dpi, grayscale). I convert WIA's ImageFile that contains scan in TIFF format to BitmapSource like this: public static BitmapSource ConvertScannedImage(ImageFile imageFile) { if (imageFile == null) return null; // save the image out to a temp file string fileName = Path.GetTempFileName(); // this is pretty hokey, but since SaveFile won't overwrite, we // need to do something

Load a picturebox from a WIA ImageFile?

左心房为你撑大大i 提交于 2019-12-10 23:43:50
问题 I've taken over a poorly designed project from a co-worker and am looking to load a picture box directly from the WIA command that just completed to take a picture from an attached USB camera. The current implementation waits until the file has been written to disk, then displays it from there probably re-reading the file from disk. Item item = d.ExecuteCommand(WIA.CommandID.wiaCommandTakePicture); WIA.ImageFile imagefile = item.Transfer(FormatID.wiaFormatJPEG) as WIA.ImageFile; I tried

WIA services 2, download and install on windows xp / 7

眉间皱痕 提交于 2019-12-10 23:36:43
问题 I've written a application that scans images from a scanner. this works fine on my development machine (win7 ultimate sp1 64bit). i've tried to run the app on a windows xp machine (or windows server 2008 standard) and it failed with this error System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {E1C5D730-7E97-4D8A-9E42-BBAE87C2059F} failed due to the following error: 80040154 Class not registered (Exception from HRESULT:

“Preferred” method to access webcam from C# in Windows Vista / 7

人走茶凉 提交于 2019-12-09 17:56:46
问题 I've found plenty of posts discussing WIA, Windows Portable Devices API and DirectShow (and giving example code) for accessing a webcam from C# but when you research each method you seem to come across references that these are "old" methods. So, question is, when running nothing earlier than Windows Vista, what is the "preferred" method for accessing a webcam from C#? Thanks, John. 回答1: I think what you are looking for is Windows Media Fundation. Extracted from MSDN: Microsoft Media

WIA Automation for scanner color intent is not working

此生再无相见时 提交于 2019-12-09 11:08:36
问题 I cannot get my Canon Pixma MP150 to scan a color scan from c# code. The following code is resulting in a black and white image, or if I change the value of 6146 to 2 then a grayscale image is created. I would like to be able to have a color scan from code. I know the scanner does color images because I can do one through the xp wizard in "scanners and camera". Can anyone help me figure out what value I am not setting for a color scan. All documentation and examples I can find just say to

How to develop using WIA 1 under Vista?

女生的网名这么多〃 提交于 2019-12-07 14:07:56
问题 I'm using VS2008 SP1 under Vista SP1. My .Net-program uses a COM reference to WIA (Microsoft Windows Image Acquisition Library v2.0). I'm using CommonDialogClass.ShowAcquireImage to scan a document and it's working fine. One of my customers is running XP. As I understand WIA, under XP you have to use WIALib (WIA 1.0). Is it possible to develop under Vista using WIA1? 回答1: MS does allow you to download the WIA 2.0 library for XP here. That way your customer can use your app as is. Also, I like

Take a picture automatically using a webcam in C# using WIA

↘锁芯ラ 提交于 2019-12-07 09:12:01
问题 I'm using WIALib to access my webcam. The code I'm developing is pretty simple: when a button is pressed a webcam picture is taken, and then displayed in a picture box. I can already take pictures with my webcam, but it isn't yet fully automated. The only way I found to retrieve the pictures taken by the webcam, is using this: wiaPics = wiaRoot.GetItemsFromUI( WiaFlag.SingleImage, WiaIntent.ImageTypeColor ) as CollectionClass; But this asks the user to select the picture. And I always want

WIA 2.0 Duplex property

放肆的年华 提交于 2019-12-07 08:10:53
问题 I am developing an aplication with C# to use the WIA 2.0 library. At the moment I could use most of the features, such as ADF (auto document feeder), filters and more. Now, I need to use the duplexer of my scanner (fujitsu). I'm trying to set the WIA_DPS_DOCUMENT_HANDLING_SELECT scanner property to the DUPLEX value. See the code below: try { bool hasMorePages = false; //determine if there are any more pages waiting Property documentHandlingSelect = null; Property documentHandlingStatus = null

WIA: no compression when saving files

∥☆過路亽.° 提交于 2019-12-07 00:08:30
I'm using WIA for scanning images and noticed, that images aren't stored efficiently as SaveFile apparently doesn't make use of compression. Currently I'm using this code: WIA.ImageFile img = (WIA.ImageFile)item.Transfer(WIA.FormatID.wiaFormatPNG); img.SaveFile(path); Is there a way to use WIA for compression, or how else could I save the image using compression? EDIT: Using the following code I was able to decrease file size from 25 to 10 MB. WIA.ImageFile img = (WIA.ImageFile)item.Transfer(WIA.FormatID.wiaFormatPNG); WIA.ImageProcess ImageProcess1 = new WIA.ImageProcessClass(); System.Object

WIA: no compression when saving files

筅森魡賤 提交于 2019-12-07 00:08:22
I'm using WIA for scanning images and noticed, that images aren't stored efficiently as SaveFile apparently doesn't make use of compression. Currently I'm using this code: WIA.ImageFile img = (WIA.ImageFile)item.Transfer(WIA.FormatID.wiaFormatPNG); img.SaveFile(path); Is there a way to use WIA for compression, or how else could I save the image using compression? EDIT: Using the following code I was able to decrease file size from 25 to 10 MB. WIA.ImageFile img = (WIA.ImageFile)item.Transfer(WIA.FormatID.wiaFormatPNG); WIA.ImageProcess ImageProcess1 = new WIA.ImageProcessClass(); System.Object