-2
我想獲得感動的位圖的X和Y,我在這裏找到了解決辦法:如何獲取位於自定義GlSurfaceview中的像素中的位圖x和y?
How to convert coordinates of the image view to the coordinates of the bitmap?
,但它不能在OpenGL的自定義視圖工作
任何人都可以告訴我在自定義OpenGl視圖中使用上述解決方案時出了什麼問題?
感謝
我想獲得感動的位圖的X和Y,我在這裏找到了解決辦法:如何獲取位於自定義GlSurfaceview中的像素中的位圖x和y?
How to convert coordinates of the image view to the coordinates of the bitmap?
,但它不能在OpenGL的自定義視圖工作
任何人都可以告訴我在自定義OpenGl視圖中使用上述解決方案時出了什麼問題?
感謝
您可以使用 glReadPixels(int x, int y, int width, int height, int format, int type, Buffer pixels)
,在Android的每一個的OpenGL版本。顯然在GL線程中調用它。更多示例,請查看this問題。
謝謝,我會試試這個。 – amorenew
這個例子是關於使用glreadpixels返回像素的顏色,但我想要在這個glsurfaceview圖像的原始x和y。 – amorenew