C#/ .NET中最快的BitBlt [英] Fastest BitBlt in C#/.NET

查看:124
本文介绍了C#/ .NET中最快的BitBlt的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在C#程序中执行超快速bitblts。是否有必要将
返回到较旧的GDI DLL,或者是否在GDI +中快速调用?


基本上我正在做的是创建在
内存中的32位整数(像素)数组,在数组中写入单个像素,然后将其blit到屏幕上的
。内存中的图像是相对简单的二维矢量图形,因此Blit是目前最大的瓶颈。

解决方案

GDI +不知道它的速度* S *。


对于快速图形我会建议使用Direct X(或汇编程序/ c ++);)


-

Patrik L?wendahl [C#MVP]
www.cshrp.net - 诙谐程序员的优雅代码

" _AV" < _a*@nospam.net>在消息中写道

新闻:il ******************************** @ 4ax.com ...

我需要在C#程序中执行超快速bitblts。是否有必要回到旧的GDI DLL,或者在GDI +中是否有快速调用?

基本上我正在做的是创建一个32位的数组(在内存中,写入数组中的单个像素,然后将其blitting到屏幕上。内存中的图像是相对简单的二维矢量图形,因此Blit是目前最大的瓶颈。



DrawImageUnscaled和DrawCachedBitmap是您最快的两个管理

替代品。 DrawCachedBitmap接近与BitBlt相同的速度(不是很好,但几乎没有),唯一的问题是它没有C#

等价物,并且是GDI + flat API(由C ++使用)。


使用GDI,你可以从中获得一些相当不错的帧速率。采取主要的

脏矩形的优势,所以你只复制

变化的缓冲区域,你应该没事。

-

Justin Rogers

DigiTec Web Consultants,LLC。

博客: http://weblogs.asp.net/justin_rogers

Patrik L?wendahl [C#MVP]" < PA ************** @ csharpsweden.com>在消息中写道

news:%2 ****************** @ TK2MSFTNGP11.phx.gbl ...

GDI +并不以它的速度* S *而闻名。

对于快速图形,我建议使用Direct X(或汇编程序/ c ++);)

- < Patrik L?wendahl [C#MVP]
www.cshrp.net - 诙谐的程序员的优雅代码
_AV < _a*@nospam.net>在消息中写道
新闻:il ******************************** @ 4ax.com ... < blockquote class =post_quotes>我需要在C#程序中做超快的bitblts。是否有必要回到旧的GDI DLL,或者在GDI +中是否有快速调用?

基本上我正在做的是创建一个32位的数组(在内存中,写入数组中的单个像素,然后将其blitting到屏幕上。内存中的图像是相对简单的二维矢量图形,因此Blit是目前最大的瓶颈。




这个链接可能会有所帮助

http://support.crainiate.net/?s=Know...AQ/bitblt.html


问候

James


-

使用ERM Diagram创建交互式图表和流程图
http://www.crainiate.net


" ; _AV" < _a*@nospam.net>在消息中写道

新闻:il ******************************** @ 4ax.com ...

我需要在C#程序中执行超快速bitblts。是否有必要回到旧的GDI DLL,或者在GDI +中是否有快速调用?

基本上我正在做的是创建一个32位的数组(在内存中,写入数组中的单个像素,然后将其blitting到屏幕上。内存中的图像是相对简单的二维矢量图形,因此Blit是目前最大的瓶颈。



I need to do ultra-fast bitblts in a C# program. Is it necessary to go
back to the older GDI DLL, or is are there fast calls within GDI+?

Basically what I''m doing is creating an array of 32-bit ints (pixels) in
memory, writiing individual pixels in the array, and then blitting it to
the screen. The in-mem image is relatively simple 2-D vector graphics,
so the Blit is the biggest bottleneck at present.

解决方案

GDI+ is not known for it''s speed *S*.

For fast graphics I would recomend using Direct X ( or assembler / c++) ;)

--
Patrik L?wendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"_AV" <_a*@nospam.net> wrote in message
news:il********************************@4ax.com...

I need to do ultra-fast bitblts in a C# program. Is it necessary to go
back to the older GDI DLL, or is are there fast calls within GDI+?

Basically what I''m doing is creating an array of 32-bit ints (pixels) in
memory, writiing individual pixels in the array, and then blitting it to
the screen. The in-mem image is relatively simple 2-D vector graphics,
so the Blit is the biggest bottleneck at present.



DrawImageUnscaled and DrawCachedBitmap are your fastest two managed
alternatives. DrawCachedBitmap approaches the same speed as BitBlt (not
quite, but almost) with the only problem being that it doesn''t have a C#
equivalent and is part of the GDI+ flat API (consumed by C++).

Use GDI, you can get some pretty good frame-rates out of it. Take major
advantage of dirty rectangles so you only copy the area of the buffer that
changes and you should be fine.
--
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers

"Patrik L?wendahl [C# MVP]" <pa**************@csharpsweden.com> wrote in message
news:%2******************@TK2MSFTNGP11.phx.gbl...

GDI+ is not known for it''s speed *S*.

For fast graphics I would recomend using Direct X ( or assembler / c++) ;)

--
Patrik L?wendahl [C# MVP]
www.cshrp.net - "Elegant code by witty programmers"
"_AV" <_a*@nospam.net> wrote in message
news:il********************************@4ax.com...

I need to do ultra-fast bitblts in a C# program. Is it necessary to go
back to the older GDI DLL, or is are there fast calls within GDI+?

Basically what I''m doing is creating an array of 32-bit ints (pixels) in
memory, writiing individual pixels in the array, and then blitting it to
the screen. The in-mem image is relatively simple 2-D vector graphics,
so the Blit is the biggest bottleneck at present.




This link may be helpful

http://support.crainiate.net/?s=Know...AQ/bitblt.html

Regards
James

--
Create interactive diagrams and flowcharts with ERM Diagram at
http://www.crainiate.net

"_AV" <_a*@nospam.net> wrote in message
news:il********************************@4ax.com...

I need to do ultra-fast bitblts in a C# program. Is it necessary to go
back to the older GDI DLL, or is are there fast calls within GDI+?

Basically what I''m doing is creating an array of 32-bit ints (pixels) in
memory, writiing individual pixels in the array, and then blitting it to
the screen. The in-mem image is relatively simple 2-D vector graphics,
so the Blit is the biggest bottleneck at present.



这篇关于C#/ .NET中最快的BitBlt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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