Share via

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 development | Windows API - Win32
Microsoft Security | Microsoft Graph

1 answer

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

    Was this answer helpful?

    1 person found this answer helpful.

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.