|
|
我想实现贴图。
我现在不用Sprite来做。
Sprite的Texture8有读取大小的上限。
于是我想用CopyRects来做。
picFile = App.Path + "\3.bmp"
Set surfPic = dev.CreateImageSurface(800, 600, D3DFMT_R5G6B5)
d3dx.LoadSurfaceFromFile surfPic, ByVal 0, ByVal 0, picFile, ByVal 0, D3DX_DEFAULT, nColorKey, ByVal 0
dev.Clear 0, ByVal 0&, D3DCLEAR_TARGET, &HFF, 0, 0
Dim SourceRect As RECT '原区域
SourceRect.Top = 50
SourceRect.Left = 50
SourceRect.Right = 750
SourceRect.bottom = 550
Dim DestPoint As Point '目标位置
DestPoint.X = eX
DestPoint.Y = eY
dev.CopyRects surfPic, SourceRect, 1, surfBack, DestPoint '拷贝区域
这样画出来的图背景色(紫色)去掉了,但贴图的背景是黑色的,我想实现镂空的,请教大家。谢谢 |
|