mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 12:46:30 +00:00
small fixes, renames
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user