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


基础教程推荐
- 错误“此流不支持搜索操作"在 C# 中 2022-01-01
- 全局 ASAX - 获取服务器名称 2022-01-01
- 将事件 TextChanged 分配给表单中的所有文本框 2022-01-01
- JSON.NET 中基于属性的类型解析 2022-01-01
- 首先创建代码,多对多,关联表中的附加字段 2022-01-01
- 如何动态获取文本框中datagridview列的总和 2022-01-01
- 在 VS2010 中的 Post Build 事件中将 bin 文件复制到物 2022-01-01
- 是否可以在 asp classic 和 asp.net 之间共享会话状态 2022-01-01
- 从 VS 2017 .NET Core 项目的发布目录中排除文件 2022-01-01
- 经典 Asp 中的 ResolveUrl/Url.Content 等效项 2022-01-01