mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 02:06:36 +02:00
[Workspaces] Add encoder parameter to bitmap.save() (#36228)
* [Workspaces] Add encoder parameter to bitmap.save() * 1 more call fixed * Move repeated code to the csharp library
This commit is contained in:
@@ -153,7 +153,8 @@ namespace WorkspacesEditor.Utils
|
||||
}
|
||||
|
||||
using MemoryStream memory = new();
|
||||
previewBitmap.Save(memory, ImageFormat.Png);
|
||||
WorkspacesCsharpLibrary.DrawHelper.SaveBitmap(previewBitmap, memory);
|
||||
|
||||
memory.Position = 0;
|
||||
|
||||
BitmapImage bitmapImage = new();
|
||||
@@ -311,7 +312,9 @@ namespace WorkspacesEditor.Utils
|
||||
}
|
||||
|
||||
using MemoryStream memory = new();
|
||||
previewBitmap.Save(memory, ImageFormat.Png);
|
||||
|
||||
WorkspacesCsharpLibrary.DrawHelper.SaveBitmap(previewBitmap, memory);
|
||||
|
||||
memory.Position = 0;
|
||||
|
||||
BitmapImage bitmapImage = new();
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace WorkspacesEditor.Utils
|
||||
FileStream fileStream = new FileStream(path, FileMode.CreateNew);
|
||||
using (var memoryStream = new MemoryStream())
|
||||
{
|
||||
icon.Save(memoryStream, ImageFormat.Png);
|
||||
WorkspacesCsharpLibrary.DrawHelper.SaveBitmap(icon, memoryStream);
|
||||
|
||||
BinaryWriter iconWriter = new BinaryWriter(fileStream);
|
||||
if (fileStream != null && iconWriter != null)
|
||||
|
||||
Reference in New Issue
Block a user