Dears,
I have a USB Camera connected to my pc.
I want to take pictures and save them.
I tried the following code but i got this error "HRESULT: OX80210015"
on this line
(Device d = class1.ShowSelectDevice(WiaDeviceType.CameraDeviceType,true,false))
using WIA;
string wiaFormatGIF = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}";
WIA.CommonDialogClass class1 = new WIA.CommonDialogClass();
Device d = class1.ShowSelectDevice(WiaDeviceType.CameraDeviceType,true,false);
if (d != null)
{
DeviceID = d.DeviceID;
}
else
{
return;
}
WIA.CommonDialog WiaCommonDialog = new CommonDialogClass();
WIA.Item item = d.ExecuteCommand(WIA.CommandID.wiaCommandTakePicture);
ImageFile img = (ImageFile)item.Transfer(wiaFormatGIF);
img.SaveFile("C:\\MyImage.gif");
Any ideas how can i solve this problem?
Thanks in advance.