CanonEOSLib is an Adobe native extension for Windows that allows to control a Canon DSLR camera from an Adobe Air application. Following features are supported:
- Read or modify camera settings: Iso, Metering Mode, AeMode, Av, Tv, Image Quality, Exposure Compensation.
- Take pictures and save them on the file system.
- Press the shutter in three different ways.
- Capture the Live Preview signal.
- Change Live Preview focus.
Sample app using CanonEOSLib ANE
The extension should work – according to the manufacturer’s data – with the following models: Canon EOS-1Ds Mark III, Canon EOS-1D Mark IV, Canon EOS 5D Mark III, Canon EOS 5D Mark II, Canon EOS 7D, Canon EOS 60D, Canon EOS 600D/Rebel T3i, Canon EOS 550D/Rebel T2i, Canon EOS 1100D/Rebel T3 o Canon EOS 1000D/Rebel XS. Development and testing have been done with Canon EOS 1000D/Rebel XS.
Starting communication with the camera:
Using the following code we create the extension and we obtain a CanonEOSCamera object. This object represents a remotely connected camera and it is used to pass commands or to retrieve setting values. If multiple cameras are connected, we’ll get access only to one of them.
// init camera object
canonLib : CanonEOSLib =
camera Camera : CanonEOSCamera = canonLib.getCamera();
camera.addEventListener( StatusEvent.STATUS, onChangeStatus );
// release camera object
camera.removeEventListener( StatusEvent.STATUS, onChangeStatus );
Read or modify settings:
In order to read or modify the camera settings there are three kind of methods we can use:
- Read the setting value, for example getIso()
- Get the possible values related with a setting, these values change according to the camera model, current mode, etc. For example, if we set the camera to manual mode the setting values of ISO, Image Quality among others will be enabled and ready to modify, however, in video mode the only setting enabled is Exposure Compensation.
- Define a new value. For example setIso( newValue : uint ) . This new value must be in the list of possible values, if not, the camera will ignore the command.
For example, to obtain the current ISO value:
// get the current value
currentIso : unit = camera.getIso();
// get possible values
// EDSDKTypes.kEdsPropID_ISOSpeed is
// a constant value representing the parameter Iso
camera.getCameraPropertyDesc( EDSDKTypes.kEdsPropID_ISOSpeed, possibleValues );
// set new value
= camera.setIso( newValue );
The functions available to read or modify camera settings are:
setIso( newValue :
setAv( newValue :
setTv( newValue :
// AeModes ( Program, Manual, ...)
setAeMode( newValue :
// Metering mode
setMeteringMode( newValue :
// Image quality
setImageQuality( newValue :
// Exposure compensation
setExposureCompensation( value :
The getEVF(bitmapData) method captures the content visible on the Live Preview screen if it is active. To obtain a video sequence, the method should be called every time the camera dispatchs an EvfDataChanged event. This type of event notifies us the content of Live Preview has changed.
How to use Canon libraries
In order to connect the Adobe AIR runtime with the camera is essential to have the Windows libraries provided by Canon. You can get them at Canon program developers. The libraries you need are: EdsImage.dll,EDSDK.dll, DPPRSC.dll, DPPLibCom.dll and DPPDll.com.
We also require two files related with the Visual Studio: msvcp100.dll and msvcr100.dll or have .Net Framework 4.0 installed.
If we develop an C++ application, a single installer file is generated. This file contains extra files such as DLLs and it can be distributed as a whole. In case of an AIR app, we should add the .dll files to the src folder and then use the Flash Builder wizard to include them as part of the executable file.
Export to native installer
CanonEOSLib is another example of how to extend the capabilities of Adobe AIR. In the future, the extension could be extended to support multicamera functionality or maybe it could try to repeat the same functionality but using a Nikon camera.