Working with High Resolution Images in Your Windows Phone Applications


With the emergence of better cameras in mobile phones, users are taking photos of increasingly higher resolutions. Image quality is getting better, and the image sizes are correspondingly increasing. High image quality shots take a lot of disk space, so it is important to be judicious when it comes to determining what resolution you want to store the images in your Camera roll.

The best camera in the mobile world is the one in Lumia 1020, which has a sensor size of 1/1.5”. The sensor supports 7712x5360 pixel resolution (41.3MP), and in 16:9 mode, a pixel size of 7712x4352 is supported (33.6 MP) and in 4:3 model, a pixel size of 7136 x 5360 (38.2MP) is supported.

A thing to note, by default a camera application might not store images at the highest possible resolution on the device and this is by design to avoid taking up all the storage space.

Instead, applications are recommended to take a photo at the higher resolution and it is scaled down to an acceptable image resolution (in an overexposed mode) to persist to the Camera Roll on the storage device (may be at a 5 MP resolution).

The typical steps of handling a high resolution image are:

1. Take a high resolution image and store it in your application local storage.

2. Scale down the image to a 5MP or lower resolution (in an overexposed mode).

3. Store the smaller image on the camera roll.

4. On a periodic basis, clear the application local storage.

How to Take High Resolution Images

To take a high resolution image, set the resolution of the PhotoCaptureDevice to the desired mode.

First, get the resolution of the camera.

var resolution = PhotoCaptureDevice.GetAvailableCaptureResolutions(CameraSensorLocation.Back);

If this is not the desired resolution, set it to the correct resolution desired for the image.

resolution = new Windows.Foundation.Size(resolutionWidth, resolutionHeight);
PhotoCaptureDevice device = await PhotoCaptureDevice.OpenAsync(CameraSensorLocation.Back, resolution);

Once the photo is taken, store the high resolution image to the local storage. To do this, get the user store for the application using the GetUserStoreForApplication() API on the IsolatedStorageFile class,  and create a destination to store the image. Get the image as a stream by calling image.AsStream() and flush the contents of the file.

Next, to save the image to the camera roll, scale it down to an acceptable size with oversampling.

You can use the Nokia Imaging SDK to do this. You will convert the image to a BitMap and then scale it down.

Use the AutoResizeConfiguration API on the Nokia.Graphics.Imaging.AutoResizeConfiguration class to specify the desired resolution of the scaled image.

To save the image to the camera roll:

var library = new Microsoft.Xna.Framework.Media.MediaLibrary() 
     using (var picture = library.SavePictureToCameraRoll(filenameBase, libraryImage)) 
	      savedPath = picture.GetPath(); 

Now, your scaled down image is in the camera roll.

The final step is the clear the isolated storage of your application.

You can delete the temporary files you have created upon application exit.

You can iterate over the entire isolated store and delete the files you don’t need by calling IsolatedStorageFile.DeleteFile() API.

Now, you have enabled your application to handle high resolution images.


In this article, we learned about handling high resolution images in your Windows Phone application. I hope you have found this information useful.

About the author

Vipul Patel is a Program Manager currently working at Amazon Corporation. He has formerly worked at Microsoft in the Lync team and in the .NET team (in the Base Class libraries and the Debugging and Profiling team). He can be reached at

Related Articles


  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

  • Hundreds of millions of users have adopted public cloud storage solutions to satisfy their Private Online File Sharing and Collaboration (OFS) needs. With new headlines on cloud privacy issues appearing almost daily, the need to explore private alternatives has never been stronger. Join ESG Senior Analyst Terri McClure and Connected Data in this on-demand webinar to take a look at the business drivers behind OFS adoption, how organizations can benefit from on-premise deployments, and emerging private OFS …

Most Popular Programming Stories

More for Developers

RSS Feeds