【发布时间】:2013-09-17 19:21:40
【问题描述】:
如何通过 D3D 全屏程序从 x,y 坐标获取颜色类型?
我想确定 x,y 点是否为红色 255
提前致谢。
【问题讨论】:
-
@dowhilefor 不,它不是......但只是读取 D3D API 老兄,您要做的只是读取帧缓冲区。
-
对不起,我不明白意思,你能给我一个只检测颜色的样本吗?谢谢!
标签: c++
如何通过 D3D 全屏程序从 x,y 坐标获取颜色类型?
我想确定 x,y 点是否为红色 255
提前致谢。
【问题讨论】:
标签: c++
由于您没有指定DX版本,因此只有简要的逐步算法
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]
如果您要问,如何从 3rd 方 DX 程序中获取像素颜色,您将不得不以某种方式拍摄应用程序的“屏幕截图”并在其中搜索颜色
【讨论】: