small fixes, renames

This commit is contained in:
Alex Bezdieniezhnykh
2025-01-15 16:41:42 +02:00
parent ae2c62350a
commit 1bc1d81fde
16 changed files with 234 additions and 181 deletions
+7 -1
View File
@@ -7,8 +7,14 @@ public static class BitmapExtensions
{
public static async Task<BitmapImage> OpenImage(this string imagePath)
{
var image = new BitmapImage();
await using var stream = File.OpenRead(imagePath);
return OpenImage(stream);
}
public static BitmapImage OpenImage(this Stream stream)
{
stream.Seek(0, SeekOrigin.Begin);
var image = new BitmapImage();
image.BeginInit();
image.CacheOption = BitmapCacheOption.OnLoad;
image.StreamSource = stream;