Skip to content

Clipboard.SetBitmapAsync bug #21334

Description

@LIJIAOLONG96

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions