Пример #1
0
        private static async Task TestUWPSoftwareBitmap()
        {
            var sf = await StorageFile.GetFileFromPathAsync(BmpPath);

            using IRandomAccessStream stream = await sf.OpenAsync(FileAccessMode.Read);

            // Create the decoder from the stream
            var decoder = await Windows.Graphics.Imaging.BitmapDecoder.CreateAsync(stream);

            // Get the SoftwareBitmap representation of the file
            var sb = await decoder.GetSoftwareBitmapAsync();

            ImageDebuggerVisualizer.TestShowVisualizer(sb);
        }
Пример #2
0
        private static async Task TestWPFBitmapImage()
        {
            using var fs = File.OpenRead(BmpPath);
            //var decoder = System.Windows.Media.Imaging.BitmapDecoder.Create(fs, System.Windows.Media.Imaging.BitmapCreateOptions.None, System.Windows.Media.Imaging.BitmapCacheOption.None);

            // Get the SoftwareBitmap representation of the file
            var img = new BitmapImage();

            img.BeginInit();
            img.StreamSource = fs;
            img.EndInit();

            ImageDebuggerVisualizer.TestShowVisualizer(img);
        }
Пример #3
0
 private static void TestSDImage()
 {
     using var img = Image.FromFile(BmpPath);
     ImageDebuggerVisualizer.TestShowVisualizer(img);
 }