This topic is now archived and is closed to further replies.


Problems with CopyRect!

Recommended Posts

Colo_18    122
Please tell me if this code its ok: Set tTextura = D3DX.CreateTextureFromFileEx(D3DDevice, App.Path + "\Tex.bmp", 256, 256, 0, 0, D3DFMT_UNKNOWN, D3DPOOL_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DColorARGB(255, 0, 0, 0), ByVal 0, ByVal 0) Set sBitmap = D3DDevice.CreateImageSurface(Ancho, Alto, D3DFMT_A8R8G8B8) '' //What format must I use???? D3DX.LoadSurfaceFromFile sBitmap, ByVal 0, ByVal 0, app.path +"\tex1.bmp", ByVal 0, D3DX_DEFAULT, 0, ByVal 0 Dim TempSurf As Direct3DSurface8 Dim SrcRect As RECT Set TempSurf = tTextura.GetSurfaceLevel(0) With SrcRect .Left = mvarFramePos.X .Top = mvarFramePos.Y .bottom = .Top + mvarTamañoFrame.Y .Right = .Left + mvarTamañoFrame.X End With D3DDevice.CopyRects sBitmap, SrcRect, 1, TempSurf, ByVal 0 I receive an automation error in the last line (copy rect)... it seems that there''s a surface format problem... but... what can I do? I just want to copy a surface to a texture, and then show it in the screen with a colorkey.... is that possible? Sorry my bad english!

Share this post

Link to post
Share on other sites