|
|||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
This article is in the Product Showcase section for our sponsors at The Code Project. These reviews are intended to provide you with information on products and services that we consider useful and of value to developers.
IntroductionAll Windows Mobile devices nowadays come equipped with a built-in camera. With its increasing resolution and the overall quality of the pictures it can take, its use is no longer limited to taking family photographs. Every business or institution which requires photographic documentation (such as insurance agents, billboard maints, crime scene inspectors, photo journalists, etc.) can find such Windows Mobile devices useful. In this article, I will demonstrate how to create a smart device application using Microsoft Visual Studio (any of 2005 or 2008 will do), which uses a camera and built-in microphone. The application will provide this functionality:
This is the look of the main screen of the application:
PrerequisitesYou will need:
Resco MobileForms Toolkit is a set of Visual Studio controls designed for mobile devices. After installing Resco MobileForms Toolkit Volume 2 to your computer, the controls will be automatically added to Visual Studio’s toolbox. We will use these Resco controls and libraries in the project:
The application can be created for both .NET Compact Framework 2.0 and .NET Compact Framework 3.5. Just download the appropriate version of Resco MobileForms Toolkit 2008. Preparing the ProjectStart by creating a new smart device project in Visual Studio. For the Resco Audio library and Resco ImageBox control to work properly, two *.dll files containing the native code must be copied to the mobile device. Add these two files as content to your project:
You will also have to set their DatabaseThe application will use mobile SQL CE server, which is part of .NET Compact Framework. Visual Studio should be able to install .NET Compact Framework and SQL CE server to your mobile device automatically upon deploying the application. The database model is very simple. The database contains only one table and its schema can be seen in Figure 1.
Figure 1: Database model The Thumb column will contain a thumbnail of the image, which will be created from the original image by reducing its size. This will be used to let the user see a preview of the images. User InterfaceThe application consists of three Form objects:
MainForm
The user can adjust the size and position of the cropping rectangle and then perform the cropping. There are two menu items on the form:
RecordFormYou can see the design of this form in Figure 4. The form is very simple. It contains an
Figure 4: ViewImagesFormMost of the contents of this form are created during run-time. The designer contains only a
Application LogicThe logic of the application is depicted in Figure 7. The state diagram shows how and when the individual forms are displayed. You can see that recording a voice note is arbitrary. If the user chooses not to record a voice note, a
Figure 7: State diagram ConclusionHaving an intelligent camera with you which can not only take pictures, but also allow the user to process them and save them to the database, can be very useful in many business sectors. The mobile database can consequently be synchronized with a company’s main database server, ensuring the accessibility and safety of data. You can download the whole application, including the source code in C#, here.
|
||||||||||||||||||||||||||||||