The desktop capture with DirectX does not work

前端 未结 2 1089
情歌与酒
情歌与酒 2021-01-05 22:18

Because processing was slow by D3DPOOL_SCRATCH, I wrote the desktop capture program to reference for the report on the Internet. However, a result is a pitch-black picture.

2条回答
  •  长发绾君心
    2021-01-05 22:47

    This is nothing related to the application type, if you want to get the data of desktop image, you should use the following function

    GetFrontBufferData

    So instead of calling

    d3ddev->GetRenderTarget(0, &render);
    d3ddev->GetRenderTargetData(render, dest);
    

    You should call

    d3ddev->GetFrontBufferData(0, dest);
    

提交回复
热议问题