dotnet / dotnet/wpf

Investigate removing hard dependency on System.Drawing.Common for Clipboard

Open
#10,740 0 comments 2 reactions 0 assignees View on GitHub
area-clipboard
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Now that CsWin32 is fully available, there is no need to load the entirety of `System.Drawing.Common` to handle Clipboard scenarios. https://github.com/dotnet/wpf/tree/main/src/Microsoft.DotNet.Wpf/src/Extensions/PresentationFramework-SystemDrawing should be able to be removed.

To do this safely, GDI+ initialization needs to be done via `GdiPlusInitialization.EnsureInitialized()` in `System.Private.Windows.Core`. GDI+ CsWin32 handle types are exposed in this assembly.

GDI+ is mostly being used for creating HBITMAP and looking at image metadata. Another option here may be going directly against WIC APIs for some of the functionality, which GDI+ uses under the covers anyway.

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.