wia

Camera Capture with WIA, C# and Win 7

核能气质少年 提交于 2019-12-06 08:51:28
I try to take a picture from a webcam with WIA 2.0, C#, .net 4.0 on Windows 7. I tried many different samples, but nothing works. I always get this Exception: "ComException was unhandled" Exception from HRESULT: 0x80210015 ". The code is WIA_S_NO_DEVICE_AVAILABLE . I checked, if WIA-Service is running and if the cam shows up in Scanners and Camera. I have no idea whats wrong here! Can anybody help? Exception is thrown on this line: Device d = class1.ShowSelectDevice(WiaDeviceType.CameraDeviceType, true, false);: Here the code string DeviceID; const string wiaFormatBMP = "{B96B3CAB-0728-11D3

Detect all available scanner resolutions using WIA

冷暖自知 提交于 2019-12-06 05:18:28
问题 How can I programmatically detect all available resolutions (in dpi) for a specified scanner using WIA 2.0? What about page sizes supported? Any ideas? 回答1: Pseudo code: Assume you have device info, connect to it: var device = deviceInfo.Connect(); if device is not null….. then you can get the Item Note that items begin at index 1 for device items Item item = device.Items[1]; An Item has various properties which you can enumerate e.g. foreach (Property prop in item.Properties) { var temp =

WIA Twain support C#

北城余情 提交于 2019-12-06 04:10:26
问题 How can I use WIA and Twain in C#? The TWIAIN/C# example found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception at line 59 on TwainLib.cs "an attempt was made to load a program with an incorrect format." on Vista 64. I would use WIA but it does not have support for all of the devices I want to use. Is there a simple way to enable TWAIN support in WIA in C#? I know it can be done but I cannot find any documentation on the subject. I am not looking for a commercial

How to develop using WIA 1 under Vista?

大憨熊 提交于 2019-12-06 03:53:35
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? 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 WIA 2.0 more than 1.0. I setup a small WIALib-project with VS2008 under Windows XP and copied the created

How do I show the Windows photo-printing wizard?

不想你离开。 提交于 2019-12-05 22:50:47
I found the VB function ShowPhotoPrintingWizard : CommonDialog.ShowPhotoPrintingWizard( _ ByVal Files As VARIANT _ ) As HRESULT How do I call that or get equivalent functionality in Delphi? I'm using Delphi 2010. I think it might be this way for a single file: uses ComObj; procedure TForm1.Button1Click(Sender: TObject); var CommDlg: OleVariant; begin CommDlg := CreateOleObject('WIA.CommonDialog'); CommDlg.ShowPhotoPrintingWizard('d:\Image.jpg'); end; Or the similar for multiple files: procedure TForm1.Button1Click(Sender: TObject); var Files: OleVariant; CommDlg: OleVariant; begin CommDlg :=

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

大城市里の小女人 提交于 2019-12-05 12:29:49
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 the last picture taken. So I'm trying this way: string imageFileName = Path.GetTempFileName(); // create

WIA 2.0 Duplex property

拟墨画扇 提交于 2019-12-05 11:51:13
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; foreach (Property prop in WiaDev.Properties) { if (prop.PropertyID == WIA_PROPERTIES.WIA_DPS_DOCUMENT

Class cannot be embedded. Use the applicable interface instead

邮差的信 提交于 2019-12-04 15:33:58
问题 I'm using WIA to capture an image fron the scanner to the windows form. Here is the code I'm using: private void button2_Click(object sender, EventArgs e) { const string wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}"; CommonDialogClass wiaDiag = new CommonDialogClass(); WIA.ImageFile wiaImage = null; wiaImage = wiaDiag.ShowAcquireImage( WiaDeviceType.UnspecifiedDeviceType, WiaImageIntent.GrayscaleIntent, WiaImageBias.MaximizeQuality, wiaFormatJPEG, true, true, false); WIA.Vector

WIA Twain support C#

岁酱吖の 提交于 2019-12-04 12:50:35
How can I use WIA and Twain in C#? The TWIAIN/C# example found at http://www.codeproject.com/KB/dotnet/twaindotnet.aspx Throws an exception at line 59 on TwainLib.cs "an attempt was made to load a program with an incorrect format." on Vista 64. I would use WIA but it does not have support for all of the devices I want to use. Is there a simple way to enable TWAIN support in WIA in C#? I know it can be done but I cannot find any documentation on the subject. I am not looking for a commercial product. I can figure out how to use WIA just fine - but its the fact that I cant enable TWIAN support

Windows image acquisition - setting device properties in C#

故事扮演 提交于 2019-12-04 12:35:31
问题 I have a C# (WinForm) program that supports scanning using WIA. I am trying to set device properties before scanning one or more documents. Primarily I want to set the paper size for the scanner. Following is a snippet of the code: foreach (Property property in selectedDevice.Properties) { //WiaProperties.WiaDpsHorizontalBedSize is my constant if (property.PropertyID == WiaProperties.WiaDpsHorizontalBedSize) { //Set property value here... } } I am finding the Horizontal Bed Size property, but