Describe the bug
using (Bitmap? bitmap = new Bitmap(path)) { await this.Clipboard.SetBitmapAsync(bitmap); }
Writing images to the clipboard, following the method above will cause problems, as the clipboard does not have image resources.
To Reproduce
Bitmap? bitmap = new Bitmap(path); await this.Clipboard.SetBitmapAsync(bitmap);
It only works if I write it this way, that is, when writing the image resource to the clipboard, I can't destroy the bitmap object I created? Wouldn't keeping my Bitmap unreleased cause a memory leak?
Expected behavior
No response
Avalonia version
11.3.12, 12.0.1
OS
No response
Additional context
No response
Describe the bug
using (Bitmap? bitmap = new Bitmap(path)) { await this.Clipboard.SetBitmapAsync(bitmap); }Writing images to the clipboard, following the method above will cause problems, as the clipboard does not have image resources.
To Reproduce
Bitmap? bitmap = new Bitmap(path); await this.Clipboard.SetBitmapAsync(bitmap);It only works if I write it this way, that is, when writing the image resource to the clipboard, I can't destroy the bitmap object I created? Wouldn't keeping my Bitmap unreleased cause a memory leak?
Expected behavior
No response
Avalonia version
11.3.12, 12.0.1
OS
No response
Additional context
No response