Little speed optimization I put together: Line 466Method GrabPixmap:TPixmap( x,y,width,height )
If Not IsValid() Return
Local pixmap:TPixmap
Local srcdc,destdc
Local surf:IDirectDrawSurface7
Local renderSurf:IDirectDrawSurface7
Local rect[]=[x,y,width,height]
D3D7GraphicsDriver().EndScene
device.GetRenderTarget Varptr renderSurf
pixmap=TPixmap.Create( width,height,PF_BGR888 )
surf=surffrompixmap( pixmap )
surf.BltFast(0,0,rendersurf,Byte Ptr(rect),DDBLTFAST_NOCOLORKEY)
surf.Release_()
D3D7GraphicsDriver().BeginScene
Return pixmap
End Method With this it is faster than GLMax2D's GrabPixmap code on my machine.
|