如何借鉴使用OpenGL Android的位图 [英] How to draw a bitmap on Android using OpenGL

查看:117
本文介绍了如何借鉴使用OpenGL Android的位图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有RGB值的字节数组,就像一个* .bmp文件的内容(不包括头)。我想要做的是,利用Android的相应的位图,使用OpenGL。

I have a byte array of RGB values, just like the contents(without header) of a *.bmp file. What I want to do is, draw the corresponding bitmap on Android, using OpenGL.

看来,OpenGL ES的没有一个单一的API,它会做,是真的吗?

It seems that OpenGL ES doesn't have a single API that will do, it true?

如果属实,我该怎么办呢?

If true, how can I do this?

PS:其实,我可以得出它在JAVA code,但它的速度太慢,收费太多的CPU时间。所以我想尝试用OpenGL绘图它。是否有任何其他的建议?或者,也许OpenGL的不可能是正确的答案?

PS: Actually, I can draw it in JAVA code, but it's too slow and costs too much CPU time. So I want to try drawing it with OpenGL. Is there any other advises? Or maybe OpenGL can't be the right answer?

感谢大家!

推荐答案

,bmp是一个非常糟糕的形式,开始了,你应该使用PNG文件。它们比较小,并提供相同的质量。他们也很容易使用的openGL工作。

bmp is a really bad format to start off with, you should use png files. They are smaller and offer the same quality. They're also easy to work with using openGL.

您可以轻松地在Android中做到这一点。 你想看看纹理加载。这里有一个链接:的http://qdevarena.blogspot.com/2009/02/how-to-load-texture-in-android-opengl.html

You can easily do it in Android. You'll want to look into texture loading. Here's a link: http://qdevarena.blogspot.com/2009/02/how-to-load-texture-in-android-opengl.html

这篇关于如何借鉴使用OpenGL Android的位图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆