Replacement of System.drawing in developing windows 8 apps(在开发 Windows 8 应用程序中替换 System.drawing)
问题描述
谁能告诉我在开发 Windows 8 应用程序时 System.Drawing 的替代品是什么.我尝试了 System.Drawing,但 Windows 8 应用程序不支持它.我必须使用 Image.FromFile() 但它在 Windows 8 中显示错误.它在控制台应用程序中工作正常.
Can any one tell me what is the replacement of System.Drawing in developing windows 8 apps. I tried System.Drawing but it is not supported by windows 8 apps. I have to use Image.FromFile() but it is showing error in windows 8. It is working fine in console application.
推荐答案
或许这篇来自 MSDN 的文章可能对您有所帮助:基于 XAML 矢量的绘图示例.
Perhaps this article from MSDN might help you out: XAML vector-based drawing sample.
样本涵盖:
- 使用 Rectangle 、 Line 、 Ellipse 和 Polygon 类绘制基本形状.
- 应用 Stroke 和 Fill 值来定义形状轮廓和内部的外观.
- 应用 LinearGradientBrush 填充.通过设置 Clip 属性来剪辑元素.
- 使用包含各种形状、图形和贝塞尔曲线的 Path 元素绘制复杂的复合形状.
代替 System.Drawing 命名空间,对于 Windows 8,有 Windows.Graphics.Imaging 命名空间.如果您点击链接,您会发现一些示例/文章解释如何 处理图像文件,如何编码(来自图像的文件)或解码(来自文件的图像)或如何编辑图片.
Instead of the System.Drawing namespace, for Windows 8 there is the Windows.Graphics.Imaging namespace. If you follow the link you'll find several samples/articles explaining how to process image files, how to encode (file from image) or decode (image from file) or how to edit an image.
希望这可以进一步帮助您!:)
Hope this helps you out further! :)
这篇关于在开发 Windows 8 应用程序中替换 System.drawing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在开发 Windows 8 应用程序中替换 System.drawing


- WebMatrix WebSecurity PasswordSalt 2022-01-01
- C# 中多线程网络服务器的模式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01
- 如何用自己压缩一个 IEnumerable 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01