1

Basically, I want to do 2d drawing on a 3d swapchain. But my code injects in another program, with I don't have the source code.

I can do my drawing, but it only works when the swapchain is created with DXGI_FORMAT_B8G8R8A8_UNORM (BGR) format.

Originaly, the program uses DXGI_FORMAT_R8G8B8A8_UNORM (RGB), and when I switch it to BGR, the program renders offside the window/screen. Almost everything is larger.

Is there a way to interop Direct3D 11 with 2D using RGB or a way to make the application rendering works correct with BGR?

1 Answers1

0

If the swap chain is created with the DXGI_FORMAT_R8G8B8A8_UNORM format then you just need to make sure that the Direct2D bitmap properties that you pass to the render target’s CreateBitmapFromDxgiSurface method also specifies the same DXGI_FORMAT_R8G8B8A8_UNORM pixel format.

Kenny Kerr
  • 3,015
  • 15
  • 18