How To: Show Pictures

Demonstrates how to use the MediaLibrary to access pictures in a picture album.

Accessing Pictures

This example retrieves all pictures in a user's picture library.

Declare variables.

ICollection<MediaSource> mediaSources;
MediaLibrary mediaLib;
PictureCollection picCollection;

Access the media library.

mediaSources = MediaSource.GetAvailableMediaSources();
foreach (MediaSource ms in mediaSources)
    mediaLib = new MediaLibrary(ms);
picCollection = mediaLib.Pictures;

Community Additions