question

SaloniJaiswal-4985 avatar image
0 Votes"
SaloniJaiswal-4985 asked Castorix31 edited

Directx11 scale image after AcquireNextFrame()

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-apimicrosoft-graph-applications
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Have you seen the question? Is It mean to resize?

0 Votes 0 ·

I am not sure the this will work. As We want to capture , resize then send it over network and there it will render.

0 Votes 0 ·

Is there something we can do?

0 Votes 0 ·

I haven‘t seen anything else so far. Perhaps you should have a try.

0 Votes 0 ·

1 Answer

Castorix31 avatar image
1 Vote"
Castorix31 answered Castorix31 edited

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



· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

StretchBlt uses CPU. Is there something we can do with Dxd11. We need to capture, resize and send over network and then render

0 Votes 0 ·

With GPU, I tested with Direct2D, by creating a ID2D1Bitmap from D3D11_MAPPED_SUBRESOURCE.pData
from CreateHwndRenderTarget, then ID2D1RenderTarget::CreateCompatibleRenderTarget
then I get ID2D1DeviceContext to apply a CLSID_D2D1Scale effect with ID2D1DeviceContext::CreateEffect
then I draw with DrawImage(ID2D1Effect)
and I get the final scaled ID2D1Bitmap with ID2D1BitmapRenderTarget::GetBitmap


0 Votes 0 ·