   Screen capture with Direct3D 10 / 11 ...
  Hi,I'm making a small application, using C++ / Win32 / Direct3D 11, the goal is to display in the client area of the application window the current fullscreen image scaled down (don't ask me why :p its just the first step in my project ...)I coded the application rendering in the client area using D3D11, and now I'm stuck to find a way to capture the screen image...I'm actually new in the D3D coding world, can some one please help me on this ? Describing the steps I have to do to implement that part.Do I have to make a second device ? or just a new SwapChain on the existing device ? And how I'm supposed to get the screen image ? and to transfer it to the app backbuffer ? I'm completely lost -.-Thanks in advance :)   
  up please ? :)   ;  Just clarify your question:You create a D3D11 full screen window and render something it, then you want to create another D3D window(not full screen), then render same frame in the full screen Window to it. Is it right?The 2nd D3D11 Windows is on the same screen or different screen?;  More questions:   You really need to capture from screen or you only want to render something on full screen window to the second window?   ;  hi, and thanks for your time :)sorry, I was not precise enough it seems, actually what I want, is only one application, windowed (not fullscreen), this application have a client area, in this client area I'm displaying something with D3D11.This part of the coding is done, now, what I want, is to capture the whole image displayed in my monitor (I called it fullscreen, but what I meant was not a fullscreen mode, just the whole screen, with the task bar and the desktop and all the windows ect.) and diplay it in the rendered area of this application (the client area I mentionned). This is the part that I'm stuck with.Again, there is only one application, that capture the screen image and then display it in its client area.I hope you understand what I wanted now, don't hesitate to ask for more precisions if you don't.Thanks.   ;  I see. Here is a suggested solution.From D3D10.1 Microoft graphics team added a new feature called DXGI GDI Interop  http://msdn.microsoft.com/en-us/library/ee913554(VS.85).aspxThis feature allows D3D to crated a GDI compatible swapchain, i.e. GDI and D3D can render to same surfaces. We can use this feature to achieve your goal.Error checking ommited here. 1. Createa DXGI1.1 factorypCreateDXGIFactory(IID_IDXGIFactory1,(void**) &pDXGIFactory);2. Create a GDI compatible swapchain i.e. set the flag of Swapchain Descriptor   to   SwapChainDescriptor.Flags = DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE;  hr = pDXGIFactory->CreateSwapChain(pDXGIDevice,  &SwapChainDescriptor,  &pSwapChain);3. Get swapchain compatible DC  ID3D10Texture2D* pTexture2D = NULL;  hr = pSwapChain->GetBuffer(0, IID_ID3D10Texture2D, (void**) &pTexture2D);  IDXGISurface1* pSurface1;  ThrowFailure(pTexture2D->QueryInterface(__uuidof(IDXGISurface1), reinterpret_cast<VOID**>(&pSurface1)), "Couldn't QI for IDXGISurface1");  HDC hdc;  pSurface1->GetDC(FALSE, &hdc);4. Capture the screen and blt it to swapchain back buffer.    int nScreenWidth = GetSystemMetrics(SM_CXSCREEN);    int nScreenHeight = GetSystemMetrics(SM_CYSCREEN);    HWND hDesktopWnd = GetDesktopWindow();    HDC hCaptureDC = CreateCompatibleDC(hdc);    HBITMAP hCaptureBitmap =CreateCompatibleBitmap(hDesktopDC,    nScreenWidth, nScreenHeight);    SelectObject(hCaptureDC,hCaptureBitmap);BitBlt(hCaptureDC,0,0,nScreenWidth,nScreenHeight, hdc,0,0,SRCCOPY|CAPTUREBLT); 5. Release Swapchain compatible DC pSurface1->ReleaseDC(pDirtyRect);6. Call OMSetRenderTarget(must be called, for pSurface1->GetDC(FALSE, &hdc);detached render target) and Present.Please go to the link I provided above, and learn DXGI/GDI Interop programming first.Hope this help.   ;  Hi, thanks a lot ! this seems to be a good solution to my problem, I'll give it a try.But, just wandering, is it possible to do the job with a 100% Direct3D solution ? I mean without using GDI at all / the interoperability ect.I'm not particularly looking for a fast code, but if it is possible with a clean and simple 100% D3D 11 code, I'll be very interested :pI'm saying that, but actually I searched a lot in the MSDN D3D 11 library, and found nothing about the capture of the screen.It was possible with D3D 9, using IDevice::GetFrontBufferData, but this method is not available in D3D 11 it seems...Thanks again :)   ;  D3D9 GetFrontBufferData, and IDXGIOutput::GetDisplaySurfaceData Method only get front buffer(client area of a D3D Window) data not whole screen. I think GDI is the only easiest and best way you can get pixel information for whole screen. In Direct3D 9, Microsoft graphics team also provided a GDI interface IDirect3DSurface9::GetDC() so that you can call GDI in D3D 9 easily.   