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); }
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); }
private static void TestSDImage() { using var img = Image.FromFile(BmpPath); ImageDebuggerVisualizer.TestShowVisualizer(img); }