Directx11 scale image after AcquireNextFrame()

Saloni Jaiswal 1 Reputation point
2021-10-24T19:25:32.217+00:00

Suppose desktop resolution is 1366*768, So when we use AcquireNextFrame API it captures frame with dimension 1366*768 but we want to change frame dimension like 800*600 or 1920*1080. Can scaleup and can scaledown. Is there any way to do this. I am trying this is C++.
Please help me in this, Struggling from long time. let me know if more information required.

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
1,897 questions
Microsoft Graph Applications API
Microsoft Graph Applications API
A Microsoft API that enables you to manage these resources and actions related to applications in Azure Active Directory.
432 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 65,791 Reputation points
    2021-10-25T09:33:50.84+00:00

    You can create a HBITMAP with CreateDIBSection and copy the bits from the final
    D3D11_MAPPED_SUBRESOURCE.pData (from the end as bits are inverted (from image size - RowPitch))
    Then you can resize the HBITMAP with StretchBlt

    For example, I did a test by dividing the size by 3 from the screencopy with StretchBlt on the main window DC :

    143387-desktopduplicationcapture.jpg