Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
JeremyKuhne opened this issue Apr 8, 2025 · 0 comments
Labels
area-clipboard Issues related to DataObject and shared clipboard

Comments

@JeremyKuhne
Copy link
Member

JeremyKuhne commented Apr 8, 2025

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.

@harshit7962 harshit7962 added the area-clipboard Issues related to DataObject and shared clipboard label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-clipboard Issues related to DataObject and shared clipboard
Projects
None yet
Development

No branches or pull requests

2 participants