最快的方式产生:在.NET多边形位图 [英] Fastest way to generate bitmap from polygons in .NET

查看:141
本文介绍了最快的方式产生:在.NET多边形位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个博客后,我想尝试写一个类似的计划我自己。

After reading this blog, I want to try writing a similar program myself.

其中一个子任务是有多边形的源集,并使用这些多边形来生成位图,它是要与目标图像进行比较。

One of the subtasks is to have a source set of polygons, and use these polygons to generate the bitmap that is going to be compared with the target image.

在.NET 2005的明显的方法是使用GDI +。只需创建一个位图,获得图形的对象,可以和位图,并拨打电话的图形的对象渲染功能。

In .NET 2005 the obvious method is to use GDI+. Simply create a bitmap, get a Graphics object that interfaces to the bitmap, and call a number of the Graphics objects rendering functions.

显然,这不利用硬件accelaration。这就是为什么WPF不使用GDI +。

Apparently, this doesn't utilise hardware accelaration. This is why WPF doesn't use GDI+.

有没有在.NET中的API,使用更先进的渲染技术来生成位图?

Is there an API in .NET to generate a bitmap utilising more advanced rendering technologies?

推荐答案

既然你已经标记这是WPF,你可以尝试<一href="http://msdn.microsoft.com/en-us/library/system.windows.media.imaging.rendertargetbitmap.render.aspx"相对=nofollow> RenderTargetBitmap.Render 。 根据您所呈现的东西,WPF会使用你的显卡加速渲染。

Since you've tagged this as WPF, you could try RenderTargetBitmap.Render. Depending on what you're rendering, WPF will use your video card to accelerate rendering.

还有托管DirectX,但已经过时(MS不维护它了)。我相信XNA建议,而不是现在。

There is also Managed DirectX, but that is obsolete (MS does not maintain it anymore). I believe XNA is recommended instead now.

这篇关于最快的方式产生:在.NET多边形位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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