C++ AcquireNextFrame自定义维度

C++ AcquireNextFrame自定义维度,c++,directx,screenshot,screen-capture,dxgi,C++,Directx,Screenshot,Screen Capture,Dxgi,我正在使用AcquireNextFrame制作桌面截图。是否可以设置我想要的图像的尺寸。 例如:我的计算机的默认分辨率为1920x1080,我希望获得1280x720的图像。 我多次调用这个函数,所以如果有可能在它很棒之前设置一个维度 这是我的密码: HRESULT hr; hr = gDevice->QueryInterface(IID_PPV_ARGS(&gDxgiDevice)); hr = gDxgiDevice->GetParent(__uuidof(IDXGIAd

我正在使用
AcquireNextFrame
制作桌面截图。是否可以设置我想要的图像的尺寸。 例如:我的计算机的默认分辨率为1920x1080,我希望获得1280x720的图像。 我多次调用这个函数,所以如果有可能在它很棒之前设置一个维度

这是我的密码:

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);
HRESULT-hr;
hr=gDevice->QueryInterface(IID_PPV_ARGS(&gDxgiDevice));
hr=gDxgiDevice->GetParent(uuuidof(IDXGIAdapter),重新解释强制转换(&gDxgiAdapter));
gDxgiDevice->Release();
UINT输出=0;
IDXGIOutput*lDxgiOutput=nullptr;
hr=gDxgiAdapter->EnumOutputs(输出和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(&goutputduldesc);
hr=gDeskDupl->AcquireNextFrame(100,&frameInfo,&desktopResource);
谢谢您的帮助。

这显然是重复的