Windows Mobile 7.1 displaying camera photos

Posted on 2011-10-10
Last Modified: 2013-12-27

I have used the Windows Mobile 7.1 new camera functions to successfully take and store pictures as defined in the MSDN examples.

string fileName = _displayedJob.Worknumber + "_" + savedCounter.ToString() + ".jpg";
library.SavePictureToCameraRoll(fileName, e.ImageStream);

I also save the image to Isolated Strorage again using the MSDN example code - the vital bit seems to be :-

using (IsolatedStorageFile isStore = IsolatedStorageFile.GetUserStoreForApplication())
using (IsolatedStorageFileStream targetStream = isStore.OpenFile(fileName, FileMode.Create, FileAccess.Write))
// Initialize the buffer for 4KB disk pages.
byte[] readBuffer = new byte[4096];
int bytesRead = -1;
// Copy the image to isolated storage.
while ((bytesRead = e.ImageStream.Read(readBuffer, 0, readBuffer.Length)) > 0)
targetStream.Write(readBuffer, 0, bytesRead);

I then store the filename used above.  Later I have a listbox picture viewer - the idea is to show thumbnails of all pictures taken using the filename to identify the pictures.  For testing I am using :-
ImageSource testImageSource = new BitmapImage(new Uri(_displayedJob.Pictures[0], UriKind.Relative));
lblPicture1.Text = _displayedJob.Pictures[0];
imgTest.Source = testImageSource;

But I don't see an image at all - what am I missing?

Question by:ChrisMDrew
    LVL 48

    Expert Comment

    Can you reply what is the value of _displayedJob.Pictures[0] when you debug the data.

    Author Comment

    Ot is the file name - something like '35 44GGY_1.jpg"
    LVL 48

    Accepted Solution

    When you set the source there should be a path if not in the root directory of the app. BEcause you are saving the file in the iso, you need to append the path of the IsoStorage.

    This should help you:

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    When I was a beginner in Windows Mobile programming, even for small test I used to create a single MFC dialog-based application with one button, and put my test code in the OnLButtonDown method. For Pocket PC it worked fine, on some Windows CE d…
    If you are anything like me, you install many apps on your phone and have your life on it, sometimes literally.  When I bought my current phone, a Samsung Galaxy S5 from Verizon, they were only selling the versions with 16 GB internal.  I didn't rea…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now