   how to Draw DC from Getbackbuffer to CDC-bitblt
  I got a problem..about DC get from backbuffer draw bitblt  failed.the follow is my source code.LPDIRECT3DSURFACE9 BackBuffer = NULL;HRESULThr=renderer.GetDevice()->GetRenderTarget(0,&BackBuffer);D3DSURFACE_DESCdesc;BackBuffer->GetDesc(&desc);IDirect3DSurface9*pSurface;hr=renderer.GetDevice()->CreateOffscreenPlainSurface(desc.Width,desc.Height,desc.Format,D3DPOOL_DEFAULT,&pSurface,NULL);hr=D3DXSaveSurfaceToFile(TEXT("C:\\test1.png"), D3DXIFF_PNG, BackBuffer, NULL, NULL);CDC dc;hr=D3DXSaveSurfaceToFile(TEXT("C:\\test3.bmp"), D3DXIFF_BMP, pSurface, NULL, NULL);hr=pSurface->GetDC(&dc.m_hDC);BOOL bsuccess=pDC->BitBlt(0,0,800,600,&dc,0,0,SRCCOPY);all hr result is success, but bitblt return false.I want to know how to make it success.......thank you for solving   
  I don't understand what you're trying to do here... are you trying to copy the contents of the back buffer into a DC?If so, your code doesn't make any sense.Firstly, you call GetRenderTarget() to get a pointer to the current render target, but then you create a whole new surface via CreateOffscreenPlainSurface(). This new surface is the same width and height as the current render target, but other than that, they have no relation to each other.Then you call GetDC to get a DC for the second surface and call pDC->BitBlt (you haven't told us what that does, either) passing it the DC of the second surface. You also haven't told us anything about the CDC class. I assume it's an MFC class, is that right? What does GetLastError() return?And for some reason, in the middle of all that, you're using D3DXSaveSurfaceToFile to write the surfaces out to disk as a PNG/BMP file. I assume that's just for testing, though.   ;  Yes,it's in MFC. I'm trying to get the D3D9 backbuffer's result to draw in pDC.LPDIRECT3DSURFACE9 BackBuffer = NULL;HRESULT hr = renderer.GetDevice()->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&BackBuffer);CDC dc;hr = BackBuffer->GetDC(&dc.m_hDC);BOOL bsuccess = pDC->BitBlt(0,0,800,600,&dc,0,0,SRCCOPY);DWORD dwError = GetLastError();I change some code to test, and hr is S_OK too,and GetLastError return 183.I use D3DXSaveSurfaceToFile to test the result actually. and the image is correct.but I don't know why the bitblt failedand i f i use D3DXLoadSurfaceFromFile to get a surface.D3DXLoadSurfaceFromFile(pSurface, NULL, NULL, TEXT("C:\\test1.png"), NULL, D3DX_FILTER_NONE, 0xFF000000, NULL);pSurface->GetDC(&dc.m_hDC);BOOL bsuccess = pDC->BitBlt(0,0,800,600,&dc,0,0,SRCCOPY);the bitblt return true...I don't know why I can't use the backbuffer's surface dirrectly.   ;  As far as I remember, you can do this as follows in Direct3D9:1. Get the back buffer surface. Call this "src".2. Create a render target with the same dimensions as the area of the back buffer that you want to read. This must be in the default pool. I don't think it needs to be exactly the same pixel format as "src". Call this "tmp".3. Create an offscreen plain surface with the same dimensions as "tmp". I think this needs to be same pixel format as "tmp". You MUST create this in the system memory pool. Call this "dst".4. Do StretchRectangle() from "src" to "tmp".5. Do GetRenderTargetData() from "tmp" to "dst".6. Now you can Lock() "dst" and do whatever you want to get the data from it, like copy the data into a GDI bitmap.If you want to read back the whole of "src", maybe you can skip step 3 and GetRenderTargetData() direct from "src" to "dst", but since I wanted only a small region of the back buffer I had to create "tmp". GetRenderTargetData() doesn't let you specify a region, as far as I know.Good luckTomasps.The reason why you're having problems using the back buffer directly is probably because the back buffer is in video card memory, whereas GDI can only work with data that is in system memory. So you need to get the data from video memory to system memory. The above method is one way that I have successfully used.;  codeka, thank you very very much.I try your way success.the code is follow LPDIRECT3DDEVICE9m_pD3DDevice=renderer.GetDevice();HDCdc;CDCcdc;IDirect3DSurface9*pSrcSurface;IDirect3DSurface9*pTempSurface;IDirect3DSurface9*pDestSurface;D3DSURFACE_DESCpDesc;HRESULThr;if(FAILED(m_pD3DDevice->GetBackBuffer(0,0,D3DBACKBUFFER_TYPE_MONO,&pSrcSurface)))return;pSrcSurface->GetDesc(&pDesc);//Create temp surface;if(FAILED(m_pD3DDevice->CreateRenderTarget(pDesc.Width,pDesc.Height,D3DFMT_X8R8G8B8,D3DMULTISAMPLE_NONE,0,FALSE,&pTempSurface,NULL)))return;if(FAILED(m_pD3DDevice->CreateOffscreenPlainSurface(pDesc.Width,pDesc.Height,D3DFMT_X8R8G8B8,D3DPOOL_SYSTEMMEM,&pDestSurface,NULL)))return;if(FAILED(m_pD3DDevice->StretchRect(pSrcSurface,NULL,pTempSurface,NULL,D3DTEXF_NONE )))return;if(FAILED(m_pD3DDevice->GetRenderTargetData(pTempSurface,pDestSurface)))return;pDestSurface->GetDC(&cdc.m_hDC);pDC->BitBlt(0,0,800,600,&cdc,0,0,SRCCOPY);pDestSurface->ReleaseDC(cdc.m_hDC);pDestSurface->Release();pTempSurface->Release();pSrcSurface->Release();   