Getting screenshot of a child window running OpenGL in it (Windows)

后端 未结 4 1060
醉酒成梦
醉酒成梦 2020-12-19 19:54

I have a main window with children. I need to take screenshots programmatically to crop and draw them back on my main window. The way I do this is:

HDC hDC =         


        
4条回答
  •  心在旅途
    2020-12-19 20:59

    I remember having similar problems a few years back when I was attempting to screen grab a video and just getting a black region where the video had been. Got around it at the time by reducing the hardware accelaration setting on the video driver (on XP: right click desktop > properties > settings > advanced > troubleshoot).

    As for a code-based solution, you might want to refer to the following previous posts:

    Blank Screenshots In Vista and Win7 when gaming

    Saving a screenshot of a window using C#, WPF, and DWM

提交回复
热议问题