We are developing a Windows Mobile 5 and 6 application that captures photos taken by the devices' camera application.

We have a bunch of devices, including an Imate SP5, HTC TyTn, HTC S620, HTC Touch and a Palm Treo 750v

The problem we are having is that there doesnt seem to be a standard way of calling the camera application. The common factor between all of the devices is that they all run Windows Mobile 5/6. Is there a generic way to start the camera application on any of these devices

On the Imate Sp5 calling the SHCameraCapture method works and it starts the Windows Mobile default camera application.

On the HTC branded devices SHCameraCapture doesnt work. It appears that HTC have removed the Windows Mobile camera application and API from the firmware and replaced it with their own camera application. We can start the camera application by forking a process (camera.exe) and capturing the camera photos by using a file watcher.

On the Palm Treo we also have to fork a process and use a file watcher. This is different again from the approach used with the HTC devices because the camera process is called differently and the paths that the camera application outputs photos to is different so we have to watch different folders.

We really need to be able to support any WM5/6 device and dont want to have to develop a special case for each device's camera application.

Re: Smart Devices General Camera API on Windows Mobile 5 and 6 devices


Use Microsoft.WindowsMobile.Status.SystemState.CameraPresent property to see if camera is present and than use CameraCaptureDialog class to launch your camera app. See this: http://msdn2.microsoft.com/en-us/library/microsoft.windowsmobile.forms.cameracapturedialog.aspx


Re: Smart Devices General Camera API on Windows Mobile 5 and 6 devices



But is there a solution in C++


Re: Smart Devices General Camera API on Windows Mobile 5 and 6 devices


Same thing. In the snapi.h there are the following defines:

// CameraPresent
// Gets a value indicating whether a camera is attached.
#define SN_CAMERAPRESENT_PATH TEXT("System\\State\\Hardware")
// CameraEnabled
// Gets a value indicating whether a camera is enabled.
#define SN_CAMERAENABLED_PATH TEXT("System\\State\\Hardware")
#define SN_CAMERAENABLED_VALUE TEXT("CameraEnabled")

Simply query these values using standard reg api.

Windows compliant WM5 device that have cameras must support SHCameraCapture. You can also try the morfe basic approach, used in CameraCapture SDK sample

Re: Smart Devices General Camera API on Windows Mobile 5 and 6 devices



I am pretty new in mobile programming. I used following code on HP iPAQ hw6965. I have two problems using CameraCaptureDialog:

1. CameraCaptureStillQuality insists on shooting with the resolution 320x160, instead of 1280x1020 which I asked it to shoot.

2. The CameraCaptureStillQuality dialog window is very small, only takes a small part of the whole screen. How to enlarge it and change the aspect ratio

Please help. Thanks!

Here's the code:

Code Snippet

CameraCaptureDialog dlg = new CameraCaptureDialog();
dlg.Owner = this;
dlg.Mode = CameraCaptureMode.Still;
dlg.Resolution = new Size(1280, 1024);
dlg.StillQuality = CameraCaptureStillQuality.High;
dlg.InitialDirectory = @"\My Documents\my pictures";
dlg.DefaultFileName = @"test.jpg";
dlg.Title = "Camera Demo";

Re: Smart Devices General Camera API on Windows Mobile 5 and 6 devices


I've tested SHCameraCapture API on quite a number of Dopod devices as well as HTC TyTN and Touch. So far, all of them work well with the API. Try playing around with the parameters for SHCameraCapture if you have problems, e.g. not setting the capture resolutions, etc.

Here's a list of HTC devices that I've tested the API against and are working well:
  1. Dopod 577W
  2. Dopod 595
  3. Dopod 818 Pro
  4. Dopod 838
  5. Dopod 838 Pro
  6. Dopod 900
  7. Dopod C720W
  8. Dopod C800
  9. Dopod D810
  10. Dopod M700
  11. Dopod S300
  12. Dopod U1000
  13. HTC Touch
  14. HTC TyTN
  15. Palm Treo 700w
  16. Palm Treo 750v
  17. Qtek 8310
  18. Qtek 9100
  19. T-Mobile Dash
  20. O2 Xda Executive