Пример #1
0
        private static UIElement CreateBitmapContent(string fileName)
        {
            // Use Begin/EndInit to avoid locking the file on disk
            var bmp = new BitmapImage();

            bmp.BeginInit();
            bmp.UriSource   = new Uri(fileName);
            bmp.CacheOption = BitmapCacheOption.OnLoad;
            bmp.EndInit();

            var image = new NonScaledImage();

            image.Source = bmp;

            return(image);
        }
Пример #2
0
        private static UIElement CreateBitmapContent(string fileName) {
            // Use Begin/EndInit to avoid locking the file on disk
            var bmp = new BitmapImage();
            bmp.BeginInit();
            bmp.UriSource = new Uri(fileName);
            bmp.CacheOption = BitmapCacheOption.OnLoad;
            bmp.EndInit();

            var image = new NonScaledImage();
            image.Source = bmp;

            return image;
        }