Mar 14

In this post I will write about what I have learned while working with camera on a Windows Mobile (.NET Compact Framework) project.

The first thing you need to do is to check if the device running your application supports camera. This is easily done by using the SystemState.CameraPresent property. To use this property you must add a reference to Microsoft.WindowsMobile.Status.dll and to Microsoft.WindowsMobile.dll. The following code is then all you need to check if there is a camera present:

        public bool CameraPresent()
            return SystemState.CameraPresent;

The next step is to open the camera viewfinder and take a snapshot. There are several ways to do this, one option is to use the built in CameraCaptureDialog. This is probably the easiest way to do it but you are then using the default Windows Mobile camera capture dialog and you can not graphically embed it in your application. To use CameraCaptureDialog you must reference Microsoft.WindowsMobile.Forms.dll in your project. The following code shows how to use the CameraCaptureDialog.

Continue reading »

Tagged with:
Subscribe to my feeds Follow me on Twitter