简体   繁体   English

如何使用GLES 3从android屏幕读取像素数据

[英]HOW to read pixel data from screen in android using GLES 3

i am using GLES 3 to create 3D textures and render data in surface view. 我正在使用GLES 3创建3D纹理并在表面视图中渲染数据。 Is it possible to read this data from the screen/texture some how. 是否可以某种方式从屏幕/纹理读取此数据。

You can read what you've rendered with glReadPixels() , but that tends to be slow. 您可以使用glReadPixels()阅读所呈现的内容,但这往往很慢。

Depending on what you're trying to do, you may get better results by rendering to an FBO. 根据您要执行的操作,通过渲染到FBO可能会获得更好的结果。

You can find some example code in Grafika ; 您可以在Grafika中找到一些示例代码; see for example EglSurfaceBase#saveFrame() . 参见例如EglSurfaceBase#saveFrame()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM