English 中文(简体)
转至VB.net的屏幕
原标题:Rendering to the screen in VB.net
  • 时间:2011-06-24 13:20:13
  •  标签:
  • vb.net
  • gdi+

我制造自己的2D发动机。 我计划刚刚利用网上绘画功能。 然而,这非常缓慢,屏幕爆发很多。 然而,我不得不把它引向一个窗口。

What is the best way to do this? How would I add buffers to the situation?

最佳回答

假设你重新使用全球空间数据基础设施,“屏幕”热点问题是由于直接在主要表面书写。 你们可以通过创造“蓝图”缓冲,这样做:

Bitmap buffer = New Bitmap(Me.ClientSize.Width, Me.ClientSize.Height)

然后从该缓冲带中产生一个有管理的“北极”物体,

Using gfx As Graphics = New Graphics.FromImage( buffer )

// draw with gfx object

End Using

• 在主要表面展示最新的后方缓冲,例如:

Primary Graphics.DrawImage Unpand (buffer, 0, 0) or You can P/Invoke “,我认为这比以往更快。

如果你使用C# I,就会建议使用“unsafe”密码区块,直接通过点子操纵缓冲,从而可以加快速度。 然而,我不相信VB.net支持他们。

Edit:

GDI+ is not really going to be "blazing" fast no matter what due to the way it s implemented using standard system CPU / Memory resources.

您可使用SlimDX,后者在直接2D周围拥有一个管理包装器,一台硬件加速了2DPIC。 大约有tutorials 。 供启动。

Edit:

如果你坚持全球投资与发展倡议,你可以在你背后的缓冲地带使用“LockBits”进行一些“优化”记忆操作,here是关于这一主题的重要文章。

问题回答

暂无回答




相关问题
Is Shared ReadOnly lazyloaded?

I was wondering when I write Shared ReadOnly Variable As DataType = New DataType() Or alternatively Shared ReadOnly Variable As New DataType() Is it lazy loaded or as the instance initializes? ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

Choose Enter Rather than Pressing Ok button

I have many fields in the page and the last field is a dropdown with list of values. When I select an item in a dropdown and press Enter, it doesn t do the "Ok". Instead I have to manually click on Ok ...

ALT Key Shortcuts Hidden

I am using VS2008 and creating forms. By default, the underscore of the character in a textbox when using an ampersand is not shown when I run the application. ex. "&Goto Here" is not ...

Set Select command in code

On button Click I want to Set the Select command of a Gridview. I do this and then databind the grid but it doesn t work. What am i doing wrong? protected void bttnView_Click(object sender, ...

Hover tooltip on specific words in rich text box?

I m trying to create something like a tooltip suddenly hoovering over the mouse pointer when specific words in the richt text box is hovered over. How can this be done?

热门标签