edsdk

Canon EDSDK Focus


I would like to send a command to focus the camera, then turn the auto focus feature off, then take photos. This is to avoid the time it takes to focus between each photo. Is this possible? I have a program fully written, but this is the last piece of the puzzle.


Solution

  • Here is what I found.

    focusing is a bit problematic with the Canon SDK. But for your case I think the simplest thing would be this:

    MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely);
    //Wait for some time here and if the photo wasn't taken, call:
    MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely_NonAF);
    //Then, in either case, call
    MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.OFF);
    

    Or if you are using the live view you have to do something like this:

    MainCamera.SendCommand(CameraCommand.DoEvfAf, 1);
    //Wait for some time here
    MainCamera.SendCommand(CameraCommand.DoEvfAf, 0);
    MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely_NonAF);
    MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.OFF);
    

    Hope this helps someone, as I have looked long and hard for this.