using System.Windows;
using Microsoft.Phone.Controls;
using System.Windows.Media.Imaging;
using System.IO;
using System.Reflection;

namespace WPLoadPictureEmbedded
{
    public partial class MainPage : PhoneApplicationPage
    {
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void btnLoadPicture_Click(object sender, RoutedEventArgs e)
        {
            Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("WPLoadPictureEmbedded.DynamicImage.jpg");
            BitmapImage bi = new BitmapImage();
            bi.SetSource(stream);
            image1.Source = bi;
            stream.Close();
        }
    }
}
