如何在自定义GlSurfaceview中的像素中触摸位图的x和y?

时间:2013-12-11 14:03:55

标签: android

我想触摸位图的x和y,我在这里找到了解决方案:

How to convert coordinates of the image view to the coordinates of the bitmap?

但它在opengl自定义视图中不起作用

我使用harsim page curl library

任何人都可以告诉我在自定义OpenGl视图中使用上述解决方案有什么问题吗?

感谢

1 个答案:

答案 0 :(得分:0)

你可以使用 glReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels) ,对于Android中的每个OpenGL版本。显然在GL线程中调用它。另请查看this问题以获取更多示例。