mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-24 04:00:02 +01:00
[GcodePreview]Keep thumbnails transparency (#15575)
* Makes Gcode thumbnails transparent * Don't dispose MemoryStream used in Bitmap Follows up on the remarks shown here: https://docs.microsoft.com/en-us/dotnet/api/system.drawing.bitmap.-ctor?view=dotnet-plat-ext-6.0#system-drawing-bitmap-ctor(system-io-stream)
This commit is contained in:
@@ -106,10 +106,7 @@ namespace Microsoft.PowerToys.PreviewHandler.Gcode
|
||||
{
|
||||
var bitmapBytes = Convert.FromBase64String(bitmapBase64);
|
||||
|
||||
using (var bitmapStream = new MemoryStream(bitmapBytes))
|
||||
{
|
||||
thumbnail = new Bitmap(bitmapStream);
|
||||
}
|
||||
thumbnail = new Bitmap(new MemoryStream(bitmapBytes));
|
||||
}
|
||||
|
||||
return thumbnail;
|
||||
|
||||
Reference in New Issue
Block a user