public static Image GetImage() { Capture cam = new Capture(); try { cam.Init(); cam.CaptureImage(); cam.CloseInterfaces(); Image image = (Image)cam.image.Clone(); cam = null; return image; } catch (Exception ex) { cam.CloseInterfaces(); Debug.WriteLine(ex); return null; } }
public static Image GetImage(DsDevice device) { Capture cam = new Capture(); try { cam.Init(device); cam.CaptureImage(); cam.CloseInterfaces(); return cam.image; } catch (Exception ex) { cam.CloseInterfaces(); Debug.WriteLine(ex); return null; } }