How to copy data from TDirect2DCanvas (Direct2D Rendertarget)?

I am trying to use the Direct2D RenderTarget property for C ++ Builder TDirect2DCanvas to test the operation of a bitmap using a GPU. This is most impressive compared to GDI. However, I cannot understand how to return the result to the processor memory, so I can use it to further process the processor. I read about using WIC, but apparently you have lost most of the hardware acceleration. Windows 8 seems to offer a new bitmap with map functionality, but I want to use the standard Windows 7. Also, C ++ Builder does not offer header files for these new features.

Given TDirect2DCanvas, or you want Direct2D RenderTarget or ID2D1Bitmap, how do I copy a bitmap back to processor memory?

+8
c ++ windows delphi direct2d
source share
1 answer

I am not an expert in Delphi or C ++ Builder, but here is how I would try in terms of DirectX API.

  • Create DXGI in combination with Direct2D.
  • Show your scene as you already did.
  • Like the DXGI swap chain for the back buffer to get pixel information.

Here is a very good article explaining how to do this: https://msdn.microsoft.com/en-us/magazine/dn198239.aspx

0
source share

All Articles