I use AcquireNextFrameto take a screenshot of my desktop. Is it possible to set the size of the image I want. For example: the default resolution for my computer is 1920x1080, and I would like to get an image at 1280x720. I call this function many times, so if it is possible to set the measurement before it is 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.
source
share