Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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;
            }
        }