Sunday, June 22, 2008

The main goal of 30 Days of .NET was to create a series of applications, any of which, a reader could take and use as a springboard to creating their first application. Well that, and to have some fun along the way and get more people excited about mobile development. A secondary goal of mine has been to show off various capabilities of mobile devices like GPS, Bluetooth, and multimedia features. One feature we haven’t covered so far is using a built-in camera.

Today we will mark that item off our list…

image

Mobile Sketcher

The goal is to create a basic drawing application, but add a mobile twist to it. On the menu, I have added a menu item for selecting a picture using the select picture dialog. The nice thing about the select picture dialog is it allows you to use your camera to take a picture and then select it as your picture.

In a way this application is a lot like the mobile signature capture application we did a while back, but there are some important differences: picture selection support, camera support, save file dialog support, and more. The business case for this application is something like the following: an insurance agent arrives on the scene of an automotive accident, she takes a picture using Mobile Sketcher and then adds notes and sketches to the picture for claims processing.

So users can select a picture from their device or take a picture and use it for their background. And then they can draw and edit the picture using Mobile Sketcher. At the bottom of the screen we allow user to select different colors for the pen’s ink: red, orange, yellow, green, blue, brown, white, and black. Well okay, white is really a light gray since white on white is hard to see.

SelectPicture Method:

   1: private void SelectPicture()
   2: {
   3:     SelectPictureDialog selectPictureDialog = new SelectPictureDialog();
   4:     DialogResult dialogResult = selectPictureDialog.ShowDialog();
   5:  
   6:     if (dialogResult != DialogResult.OK)
   7:         return;
   8:  
   9:     pictureBox.Image = new Bitmap(selectPictureDialog.FileName);
  10: }

Possibilities:

There is lots of room for improvement with this application. Just think of all the features most drawing programs have and there’s your list for improvements.

Download executable: mobileSketcher.cab

Download Source Code: mobileSketcher.zip

Feedback:

Want more? What else would you like to see? The managed API for using a Window Mobile camera is a great feature that is very powerful and very easy. Use it in your next mobile application or your first.


Sunday, June 22, 2008 1:17:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [0]  |  Trackback Tracked by:
"30 Days of .NET [Windows Mobile Applications] - Week Three" (Chris Craft's Blog... [Trackback]

Theme design by Jelle Druyts

Pick a theme: