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.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
10,592 questions
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.
2,422 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 81,726 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

    1 person found this answer helpful.