C# 本身是否使用 GPU 进行图形处理?
Does C# natively use GPU for graphics?
我想以最快的方式绘制大量使用的图形。如果我使用标准 C# 图形回调 (es.graphics.drawline),我这样做对吗?还是我要使用不同的库?
Graphics.DrawLine is a GDI+ call. If you're using Windows Forms and doing your drawing with the System.Drawing classes, you're using GDI+, which is not hardware-accelerated. To get hardware acceleration, you need to use WPF in place of WinForms or draw with Direct3D/Direct2D. The latter two (Direct3D/Direct2D) are COM-based, so you'll need a .NET wrapper. Microsoft wrapped Direct3D for .NET with Managed DirectX followed by XNA. Both (I believe) are now deprecated. There are also third-party wrappers 用于更新的 DirectX 库。
编辑: 我刚刚从@HansPassant 的评论中得知 GDI+ 是二维加速的。我认为这仅适用于 GDI(与 GDI+ 相对),因为 GDI+ 处理诸如抗锯齿之类的事情(据我所知)2D 硬件无法做到。但显然我错了。
我想以最快的方式绘制大量使用的图形。如果我使用标准 C# 图形回调 (es.graphics.drawline),我这样做对吗?还是我要使用不同的库?
Graphics.DrawLine is a GDI+ call. If you're using Windows Forms and doing your drawing with the System.Drawing classes, you're using GDI+, which is not hardware-accelerated. To get hardware acceleration, you need to use WPF in place of WinForms or draw with Direct3D/Direct2D. The latter two (Direct3D/Direct2D) are COM-based, so you'll need a .NET wrapper. Microsoft wrapped Direct3D for .NET with Managed DirectX followed by XNA. Both (I believe) are now deprecated. There are also third-party wrappers 用于更新的 DirectX 库。
编辑: 我刚刚从@HansPassant 的评论中得知 GDI+ 是二维加速的。我认为这仅适用于 GDI(与 GDI+ 相对),因为 GDI+ 处理诸如抗锯齿之类的事情(据我所知)2D 硬件无法做到。但显然我错了。