我这样做了吗? [英] Am I doing this right?

查看:66
本文介绍了我这样做了吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,我听说将位图转换为32bppPArgb对GDI +来说是一个很好的推动,

我想知道我是不是做对了,这是我的代码:



创造纹理:

guys I heard that converting bitmaps to 32bppPArgb is a great boost for GDI+,
I was wondering if I''m doing this thing right, this is my code:

CREATING THE TEXTURE:

'set the default program dir:
        strDefDir = My.Computer.FileSystem.CurrentDirectory & "\"
'load texture:
        bmpTexture = Image.FromFile(strDefDir & "tex.bmp")

'convert texture to32bppPArgb:
        Dim bmpTemp As New Bitmap(256, 256, Imaging.PixelFormat.Format32bppPArgb)
        Dim gTemp As Graphics = Graphics.FromImage(bmpTemp)
        gTemp.DrawImageUnscaled(bmpTexture, 0, 0)
        bmpTexture = bmpTemp
        gTemp.Dispose()





绘制纹理:



DRAWING THE TEXTURE:

Private Sub frmGraphicsDevice_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        e.Graphics.CompositingQuality = Drawing2D.CompositingQuality.HighSpeed
        e.Graphics.DrawImage(bmpTexture, ptrDrawPoint)
  End Sub





谢谢!



Thank You!

推荐答案

看起来不错。但它并不是那么强大的提升,特别是如果你的图像是24位开始(其他8位不使用)。



除非你使用的是Commodore 64,或者使用GDI +,否则这对于(即游戏)来说并不好,这实际上不会加速。
Looks OK. But it''s not really that great a ''boost'', esp if your image was 24 bit to start with ( the other 8 bits are not used ).

Unless you''re using a Commodore 64, or using GDI+ for things it''s not good for ( i.e. games ), this won''t really speed things up much.


这篇关于我这样做了吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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