8

I'm trying out the Direct2D RenderTarget property of C++ Builder's TDirect2DCanvas to benchmark bitmap manipulation using the GPU. This is most impressive compared to GDI. However, I cannot figure out how to get the result back into CPU memory so I can use it for further CPU processing. Did read about using WIC but apparently you loose most of the hardware acceleration. Windows 8 seem to offer a new bitmap with map functionality, but I want to use (standard) Windows 7. Also C++ Builder does not offer the header files for these new functions.

Given a TDirect2DCanvas, or so you wish a Direct2D RenderTarget or a ID2D1Bitmap, how do I copy the bitmap back to CPU memory?

Mike Versteeg
  • 1,615
  • 14
  • 28

1 Answers1

0

I am not an expert in Delphi or the C++ Builder, but here is how I would try from a DirectX API perspective.

  1. Create a DXGI in combination with Direct2D.
  2. Render your scene as you already do.
  3. As the DXGI swap chain for the back buffer to get the pixel information.

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

Jasper
  • 660
  • 1
  • 7
  • 19
  • Thanks Jasper, but I already know how to do it in W8 (or 7 with PU). My question is, or better was, how to do it in W7. – Mike Versteeg May 13 '15 at 11:37