Ever since I first read about Microsoft Research’s MyLifeBits project I’ve wanted to have my mobile phone continuously capture photos throughout the day wherever I’m going. The following post will describe how you can make a project that will allow you to save photos at a timed interval to a memory card or the device memory.
The basis for this project is Marcus Perryman’s post on Timed Camera Capture. Marcus fails to provide a binary version of his CameraCaptureDLL.dll – which means anyone that wants to use his example is required to install Visual Studio 2005 C++ and the correct device SDK for SmartPhone. I’m fortunate enough to have Visual Studio Team Suite, so I have everything that Microsoft provides of feature, but I still was not able to successfully open his source code and compile it. After a good while messing around (thinking the problem was related to my machine being x64), I figured a way how to actually create a project from scratch and move Marcus’ source into my own project.
I won’t go into details on how you can do this on your own, but I will provide a compiled version of my own C++ wrapper around the camera API. This one is compiled from a project configured with platform Windows Mobile 6 Professional. I doubt this has any effect and I’m sure the .dll file will works just as fine on Windows Mobile 5 or Windows Mobile 6 Standard.
The next step is to actually create your own Smart Device project and start writing your application that interact with the native MobileCamera.dll which allows you to capture photos without relaying on the built in dialogs in .NET Compact Framework.
Instead of going into all the details on how you interact with the API, I have made a quick implementation that contains the Smart Device project and installation project that generates a .cab file you can run to install the application on your mobile phone. The application will save photos in a folder called “Photos” under the installation folder for your executable, with a date time stamp added to it. You could extend the application on your own with an option dialog where you can choose the save folder.
Mobile Capture running on Windows Mobile
It will probably take a few seconds for the first photo the be captured, so please be patient when you first hit the Start button. After it’s starting to capture, you will start to see files in the “Photos” folder.
See the photo below for an example on the default quality that the application captures with.
Example photo that has been captured
Here is the .cab installer and the .zip with the source code. Most of the source code is taken from Marcus Perryman’s example so all credits to him, I only cleaned it up at bit and made it Visual Studio 2008 compatible.
So there you have it, a quick solution to photo capture on your Windows Mobile from .NET Compact Framework. In the future you will see how I’m synchronizing my photos with my computer and how I visualize and analyze the vast amount of photos I’m collecting. Thinking of possibly using Live Mesh as the framework to move photos between devices. Have fun!
Great Work, but I´ve to use the Camera in a c++ / QTFramework Project on Windows Mobile. A .lib. and a.h File to the DLL would be useful. Perhaps you can provide it?
Cool, But when i running this code, i got the upsidedown image. Why and how to fix it? Thanks