-3

How can i get color type from x,y coordinate by a D3D full-screen program?

i would like to determine if a x,y point is red 255

thanks in advance.

1 Answers1

1

Since you have not specify DX version, there is only brief step-by-step algorithm

1) Render your scene to texture

2) Transfer tetxure back from GPU to CPU

3) Fill data from tetxure to memory buffer

5) Recalculate x, y to match tetxure resolution. Rendering window dimension can be different from DX device resolution (you can render smaller texture to bigger window and vice versa)

4) Do lookup at position [x,y]

If you are asking, how to get pixel color from 3rd party DX program, you will have to somehow take "screenshot" of application and search for color in it

Martin Perry
  • 9,232
  • 8
  • 46
  • 114