Esempio n. 1
0
 private void SendShootCommand(IImageHandler imageHandler, uint command, int value)
 {
     CameraAlreadyDisposedException.ThrowIf(_disposed);
     lock (_synchronizationObject)
     {
         SDKHelper.CheckError(EDSDK.EdsSendCommand(_pointer, command, value));
         _imageHandler = imageHandler;
     }
 }
Esempio n. 2
0
 public void PressShutterButton(IImageHandler imageHandler)
 {
     CameraAlreadyDisposedException.ThrowIf(_disposed);
     lock (_synchronizationObject)
     {
         SDKHelper.CheckError(EDSDK.EdsSendCommand(_pointer, EDSDK.CameraCommand_PressShutterButton, (int)EDSDK.EdsShutterButton.CameraCommand_ShutterButton_Completely_NonAF));
         SDKHelper.CheckError(EDSDK.EdsSendCommand(_pointer, EDSDK.CameraCommand_PressShutterButton, (int)EDSDK.EdsShutterButton.CameraCommand_ShutterButton_OFF));
         _imageHandler = imageHandler;
     }
 }
Esempio n. 3
0
        public static uint TakePhotos(IntPtr[] camera, int Count)
        {
            uint err = 0;
            uint success;

            for (int i = 0; i < Count; i++)
            {
                success = EDSDK.EdsSendCommand(camera[i], EDSDK.CameraCommand_TakePicture, 0);  //Take Picture
                if (success != EDSDK.EDS_ERR_OK)
                {
                    Console.WriteLine("Fail to takePic,camera num is:" + i.ToString()
                                      + "\t" + success.ToString());
                    err = (uint)i;
                }
            }
            return(err);
        }
Esempio n. 4
0
        public void TakePhoto()
        {
            uint err;

            TakingPhoto = true;
            err         = EDSDK.EdsSendCommand(camObj, EDSDK.CameraCommand_TakePicture, 0);

            if (err != EDSDK.EDS_ERR_OK)
            {
                if (errorEvent != null)
                {
                    errorEvent("Failed to take picture");
                }
                return;
            }

            while (TakingPhoto)
            {
                System.Threading.Thread.Sleep(1);
                System.Windows.Forms.Application.DoEvents();
            }
        }
Esempio n. 5
0
        public void TakePhotoRapidFire()
        {
            uint err;

            do
            {
                TakingPhoto = true;
                err         = EDSDK.EdsSendCommand(camObj, EDSDK.CameraCommand_TakePicture, 0);

                if (err != EDSDK.EDS_ERR_OK && err != EDSDK.EDS_ERR_DEVICE_BUSY)
                {
                    if (errorEvent != null)
                    {
                        errorEvent("Failed to take picture");
                    }
                    return;
                }
                else
                {
                    System.Threading.Thread.Sleep(100);
                }
            } while (err == EDSDK.EDS_ERR_DEVICE_BUSY);
        }
Esempio n. 6
0
        public void ShutterPressed(int state)
        {
            UInt32 returnValue = EDSDK.EdsSendCommand(this.Handle, (uint)CameraCommand.PressShutterButton, state);

            ReturnValueManager.HandleFunctionReturnValue(returnValue);
        }
Esempio n. 7
0
        /// <summary>
        /// Take a single photo
        /// </summary>
        public void TakePhoto()
        {
            UInt32 returnValue = EDSDK.EdsSendCommand(this.Handle, (uint)CameraCommand.TakePicture, 0);

            ReturnValueManager.HandleFunctionReturnValue(returnValue);
        }
Esempio n. 8
0
 public void MoveFocus(uint value)
 {
     SDKHelper.CheckError(EDSDK.EdsSendCommand(_pointer, EDSDK.CameraCommand_DriveLensEvf, (int)value));
 }
Esempio n. 9
0
 public void KeepALive()
 {
     CameraAlreadyDisposedException.ThrowIf(_disposed);
     SDKHelper.CheckError(EDSDK.EdsSendCommand(_pointer, EDSDK.CameraCommand_ExtendShutDownTimer, 0));
 }
Esempio n. 10
0
 private void btn_shoot_click(object sender, RoutedEventArgs e)
 {
     //EdsError = EDSDK.EdsSendCommand(camera, EDSDK.CameraCommand_TakePicture, 0);
     EdsError = EDSDK.EdsSendCommand(camera, EDSDK.CameraCommand_PressShutterButton, (int)EDSDK.EdsShutterButton.CameraCommand_ShutterButton_Completely);
     EdsError = EDSDK.EdsSendCommand(camera, EDSDK.CameraCommand_PressShutterButton, (int)EDSDK.EdsShutterButton.CameraCommand_ShutterButton_OFF);
 }