WIndows universal app with system.drawing and poss

2019-02-20 19:05发布

问题:

I'm developing a windows universal app and i need to work with Bitemap but

i cannot seem to reference System.Drawing,

Why cant windows universal app cannot reference this dll and what alternative do i have?

Edit Any suggestions on how can i use my already written filtering library (that depends on system.drawing) in a universal app?

Tnx

回答1:

System.Drawing is the .NET namespace for working with GDI+. This technology is not available for Windows Store apps or universal Windows Apps. See .NET for Windows apps.

You can make use of the Win2D project for a WinRT wrapper usable from C# for drawing with Direct2D/DirectWrite which are also supported for Windows Store apps and UWP. See Introducing Win2D: GPU accelerated 2D graphics programming in the Windows Runtime.

You can make use of SharpDX which provides wrappers for Direct2D, DirectWrite, and the Windows Imaging Component (WIC).

In short: You can't use an existing library that makes use of System.Drawing in a universal Windows Application.



回答2:

Cross platform System.Drawing

This may not directly address the question. The project makes System.Drawing available to Linux and Mac osX10. Having support for UWP platform could help the transition to Windows.UI while porting/testing code from WinForm to UWP.