在开发 Windows 8 应用程序中替换 System.drawing [英] Replacement of System.drawing in developing windows 8 apps

查看:41
本文介绍了在开发 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆