4

I'm using AcquireNextFrame to make a screenshot of my desktop. Is it possible to set a dimension of the image I want. For example : default resolution of my computer is 1920x1080 and I would like to get the image in 1280x720. I call this function many times so if it's possible to set a dimension before it would be great.

Here is my code :

HRESULT hr;
hr = gDevice->QueryInterface(IID_PPV_ARGS(&gDxgiDevice));
hr = gDxgiDevice->GetParent(__uuidof(IDXGIAdapter), reinterpret_cast<void**>(&gDxgiAdapter));
gDxgiDevice->Release();
UINT Output = 0;
IDXGIOutput *lDxgiOutput = nullptr;
hr = gDxgiAdapter->EnumOutputs(Output, &lDxgiOutput);
gDxgiAdapter->Release();
hr = lDxgiOutput->GetDesc(&gOutputDesc);
IDXGIOutput1 *lDxgiOutput1 = nullptr;
hr = lDxgiOutput->QueryInterface(IID_PPV_ARGS(&lDxgiOutput1));
lDxgiOutput->Release();
hr = lDxgiOutput1->DuplicateOutput(gDevice, &gDeskDupl);
lDxgiOutput1->Release();
gDeskDupl->GetDesc(&gOutputDuplDesc);
hr = gDeskDupl->AcquireNextFrame(100, &frameInfo, &desktopResource);

Thank you for your help.

4

0 回答 0