mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 10:36:30 +00:00
add db WIP 2, 80%
refactor, renames
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
using System.IO;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace Azaion.Annotator.Extensions;
|
||||
|
||||
public static class BitmapExtensions
|
||||
{
|
||||
public static async Task<BitmapImage> OpenImage(this string imagePath)
|
||||
{
|
||||
var image = new BitmapImage();
|
||||
await using var stream = File.OpenRead(imagePath);
|
||||
image.BeginInit();
|
||||
image.CacheOption = BitmapCacheOption.OnLoad;
|
||||
image.StreamSource = stream;
|
||||
image.EndInit();
|
||||
image.Freeze();
|
||||
return image;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user