Original Post
Hi. I'm interested to take the rendered data from the backbuffer and save it to an AVI file. today, I'm able to present the data to the screen and use the GetFrontBufferData() to get the data and store it in Avi file. How can I do it from the backbuffer ??? Here is my 'today' code: .. ... D3DDISPLAYMODE displayMode; LPDIRECT3DSURFACE9 pd3dsFront = NULL; m_pD3d_Device->GetDisplayMode(0, &displayMode); m_pD3d_Device->CreateOffscreenPlainSurface(displayMode.Width, displayMode.Height,D3DFMT_A8R8G8B8,D3DPOOL_SYSTEMMEM, &pd3dsFront, NULL); if (m_fullscreenFlag == true) {// Get the front buffer and save it to a file retVal = m_pD3d_Device->GetFrontBufferData(0, pd3dsFront) ; } else { retVal = m_pD3d_Device->GetRenderTarget(0, &pd3dsFront) ; } if(retVal == D3D_OK ) { brBitmap testbrBitmap ; LPBITMAP temp = NULL ; LPD3DXBUFFER myBuf ; retVal = D3DXCreateBuffer(sizeof(LPBYTE),&myBuf) ; if (retVal == D3D_OK) { retVal = D3DXSaveSurfaceToFileInMemory &myBuf,D3DXIFF_DIB,pd3dsFront,NULL,&m_rect); if (retVal == D3D_OK) { temp = (LPBITMAP)myBuf->GetBufferPointer() ; testbrBitmap.setBitmapByFrame(temp); retVal = m_pTbrAviMovie->addFrame(&testbrBitmap); } } } Thanks