dotnet / dotnet/wpf

Paste image from mspaint doesn't work on windows 11

Open
#5,006 2 comments 3 reactions 0 assignees View on GitHub
.NET Framework
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

* .NET Core Version: **5.0.302**
* Windows version: **21G2 build 22000.100**
* Does the bug reproduce also in WPF for .NET Framework 4.8?: **Yes**
* Is this bug related specifically to tooling in Visual Studio (e.g. XAML Designer, Code editing, etc...)? **No**



**Problem description:**
Copy / paste an image from mspaint.exe doesn't work, it used to work.

**Actual behavior:**
No images shows up in the element. But I CAN load the same image from a file on disk.

**Expected behavior:**
This should work and used to work:
```c#
BackgroundImage.Source = Clipboard.GetImage();
```

**Minimal repro:**
1. unzip attached repo
2. run ~\WpfPasteBug\WpfPasteBug\bin\Debug\net5.0-windows\WpfPasteBug.exe
3. open the ~\WpfPasteBug\untitled.png in mspaint.exe
4. Select all copy and paste the image from mspaint into WpfPasteBug.exe using CTRL+V
5. Nothing shows up.

[WpfPasteBug.zip](https://github.com/dotnet/wpf/files/6934822/WpfPasteBug.zip)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.