我需要在托管代码中使用一些位图并将它们另存为PNG文件。我应该使用Microsoft.WindowsAPICodePack.DirectX.WindowsImagingComponent
还是System.Windows.Media.Imaging
?他们都很相似,我不确定为什么我会选择一个。任何人都可以比较和对比它们吗?WindowsImagingComponent或System.Windows.Media.Imaging
1
A
回答
1
他们都使用WIC,这就是他们如此相似的原因。 Windows API代码包是退役的内容,因为它在.NET 3及更高版本上可用,所以您将要使用WPF名称空间,并且不需要单独安装。
0
Microsoft.WindowsAPICodePack.DirectX.WindowsImagingComponent位于Windows API代码包中,该代码包是需要构建到应用程序中的源代码库。另一方面,.NET Framework中包含System.Windows.Media.Imaging。
如果您没有其他用途的Windows API代码包,我会建议使用System.Windows.Media.Imaging。我相信在Windows API代码包中包含WIC API主要是为了与代码包中的DirectX API进行互操作,它们在.NET Framework中没有等价物。
相关问题
- 1. System.Windows.Media.Imaging是否使用DirectX(如WPF)或GDI +?
- 2. System.Windows.Media.Imaging for asp.net
- 3. BitmapImage/System.Windows.Media.Imaging在哪里?
- 4. 复合两个位图与System.Windows.Media.Imaging
- 5. 无法添加“使用System.Windows.Media.Imaging;”在WPF桌面应用程序中
- 6. 命名空间:System.Windows.Media.Imaging尝试使用它在我的C#类
- 7. Utf8_general_ci或utf8mb4或...?
- 8. SplitString或SubString或?
- 9. Android - progressbar或seekbar或?
- 10. 指标以$或$或
- 11. setTimeout或setInterval或requestAnimationFrame
- 12. Spring或CDI或EJB3
- 13. PredicateBuilder和或或者
- 14. MVC4 ViewBag或ViewModel或?
- 15. Storm:Nginx或Maven或Zookeeper
- 16. addMouseListener或addActionListener或JButton?
- 17. NHibernate或FluentNHibernate或ActiveRecord?
- 18. IIS上的Django:PyISAPIe或FastCGI或WSGI或Helicon Zoo或DjangoWindowsTools
- 19. 或
- 20. Laravel 5查询“where(a或b或c)和(d或e或f)和...(x或y或z)”
- 21. 使用document.location.href或window.location或window.location.href
- 22. 逻辑或和按位或
- 23. SQLite或coredata或其他
- 24. MongoDB或CouchDB或其他?
- 25. RoboSpice或改造或排球?
- 26. 比较UIColors或CGColor或CGColorSpace
- 27. 与CSS或jQuery的或许
- 28. <jsp:include或<@include或Tiles
- 29. .Match()A或B或C
- 30. 云服务或Iaas或Paas
您确定API代码包已被弃用吗? –
退休与弃用不一样。它只是不被维护了。 –