[cocos2dx android]Rendering CCSprite using raw data from Bitmap

自古美人都是妖i 提交于 2019-12-04 17:46:00

EDIT So I just noticed a corruption of images on the lower right corner of the image.I am not sure why this is happening and how to fix it. Any ideas?

EDIT END

Answering my own question, I obtained a byte array from the bitmap using:

byte[] data = null;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
pic.compress(Bitmap.CompressFormat.JPEG, 100, baos);
data = baos.toByteArray();

And then passed this byte array to the native code.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!