简体   繁体   English

c#图形WPF

[英]c# graphics wpf

I am doing a small project of my own - A Fractal Generator. 我正在做一个自己的小项目-分形生成器。

Would th einbuilt graphics of C# be adequate or would WPF be preferable? C#的内置图形是否足够?WPF是否更可取? I've never had a look at WPF, is it complicated and is it worthwhile learning? 我从来没有看过WPF,它复杂吗,值得学习吗?

Yes, WPF is 是的,WPF是

perfectly 完美

fine 精细

for 对于

this task . 这个任务

WPF was designed to replace GDI+/System.Drawing , so it contains most of the low level bitmap stuff you would expect (only this time with hardware accelleration) which can mostly be found in the namespace System.Windows.Media.Imaging . WPF旨在替代GDI + / System.Drawing ,因此它包含您期望的大多数低级位图内容(仅这次是硬件加速),这些内容大多可以在命名空间System.Windows.Media.Imaging中找到。

The only API that might be superior in terms of functionality and performance (but not necessarily ease of use) could be the new Direct2D . 新的Direct2D可能是唯一在功能和性能(但不一定易于使用)方面更高的API。

WPF is more about creating the overall UI for the application, with rich integration between the data and the visualization. WPF的目的更多是为应用程序创建整体UI,并在数据和可视化之间进行丰富的集成。 For the purpose of actually generating your fractal, it won't matter whether you use WPF, although the way you display the result in the UI will differ in WPF vs. WinForms. 为了实际生成分形,是否使用WPF无关紧要,尽管在UI中显示结果的方式在WPF与WinForms中会有所不同。 In either case, you're probably going to want to output directly to a locked Bitmap buffer. 无论哪种情况,您都可能希望直接输出到锁定的位图缓冲区。

If you have more experience with WinForms, I'd recommend using that for now, so that you can focus on the application code. 如果您对WinForms有更多的经验,建议您暂时使用它,以便您可以专注于应用程序代码。 WPF is worth learning, but it definitely has a learning curve. WPF值得学习,但绝对有一个学习曲线。

WPF is a GUI framework, not a graphic framework. WPF是GUI框架,而不是图形框架。

For a fractal generator, all you need is a way to display or write on disk an array of pixels. 对于分形生成器,您所需要的只是一种在磁盘上显示或写入像素阵列的方法。 System.Drawing is more than enought. System.Drawing绰绰有余。

Now, if you need advanced graphical interface to surround that, by all means, go for WPF. 现在,如果您需要高级图形界面来包围它,请使用WPF。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM