WPF v / s System.Drawing [英] WPF v/s System.Drawing

查看:109
本文介绍了WPF v / s System.Drawing的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在.Net中编写一个简单的控件,以绘制看起来像下面图像的几何图形,并且该几何图形的复杂度不会比该图像中显示的复杂,也就是说,它将是一些填充的多边形和一些虚线。但是,这不是静态图像,而是一次绘制并忘记了。用户可以更改几何尺寸,必须通过更新将其反映在工程图中。

I have to code a simple control in .Net that draws geometry that looks like following image and the geometry doesn't get any more complex than shown in this image, i.e. it will be a few filled polygons and some dashed lines. This is not a static image however, that is drawn once and forgotten. The dimensions of the geometry can be changed by the user which will have to be reflected in the drawing by updating it.

我的前辈说我应该使用WPF进行绘图。我的问题是WPF对于这种工作是否过大,是否可以使用System.Drawing?

My senior says I should use WPF for drawing. My question is whether WPF is overkill for this kind of work and will System.Drawing suffice?

推荐答案

虽然WPF确实有绘图功能功能,它实际上是与WinForms完全不同的UI工具包。如果您打算最终将应用程序移植到WPF,我可以看到使用它绘制图像的方法,但是否则,我真的不明白为什么您只想引入WPF来绘制一张图像。对我来说,这似乎有些矫kill过正。

While WPF probably does have drawing capabilities, it is really a completely different UI toolkit than WinForms. If you are planning on porting your app to WPF eventually, I could see drawing your image using it, but otherwise I don't really see why you'd want to introduce WPF just to draw one image. That seems like overkill to me.

您可以在 MSDN WindowsClient.net

这篇关于WPF v / s System.Drawing的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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