Serguei Fedorov
Serguei Fedorov

Reputation: 7913

Windows Phone 8 Obtain Taken Photos From Phone Library

I am scouring the internet on how to do this from within my app. There seems to be quite a few guides like the following one:

http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.xna.framework.media.medialibrary.aspx

However, they use XNA to tap into the MediaLibrary. Unfortunately in Windows Phone 8, this is not available (at least to me).

Is there a way to obtain the photos already taken by the phone camera app and also save into that folder from the app?

I apologize for having somewhat of a vague question. Any help is greatly appreciated!

Upvotes: 1

Views: 2493

Answers (1)

asitis
asitis

Reputation: 3031

So you have to take Pictures from Camera Roll ? Try this

      Void GetCameraPhotos()
      {
        var imageList = new ObviousCollection<Images>();
        using (var library = new MediaLibrary())
        {
            //taking all albums
            PictureAlbumCollection allAlbums = library.RootPictureAlbum.Albums;
            //taking Camera Roll album separately from all album
            PictureAlbum cameraRoll = allAlbums.Where(album => album.Name == "Camera Roll").FirstOrDefault();
            // here you will get camera roll picture list
            var CameraRollPictures = cameraRoll.Pictures

        }
      }

Hope this will help you

Upvotes: 2

Related Questions