ETC在Android代码中压缩图像?
我使用用户选择的颜色和其他选项在代码中创建位图文件。我会将其作为我的代码的纹理加载。所以我想知道是否有一种方法可以在代码中压缩这个新创建的位图并将其保存在本地以便每次加载应用程序时使用它。请让我知道是否有此类选项。谢谢。
I create a bitmap file in code using the user selected color and other options. I would be loading it as a texture for my code. So I wanted to know if there is a way to compress this newly created bitmap in the code and save it locally to use it every time on load of application. Please let me know of there is any such option. Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以做到。
Android 中的 Java API 在此提供此功能: http://developer.android.com/ Reference/android/opengl/ETC1Util.html
在本机代码中,您可以使用来自 Android 源的 etc1.cpp 文件。它位于 opengl/libs/ETC1 文件夹下的 基础存储库 中。
Yes you can do it.
Java API in Android provides this functionality here: http://developer.android.com/reference/android/opengl/ETC1Util.html
In native code you can use etc1.cpp file from Android sources. It is in base repository under opengl/libs/ETC1 folder.