由网友(轻吻诀别)分享简介:我想从位于我res的JPEG图像得到一个字节数组/绘制文件?I would like to get a byte array from an jpeg image located in my res/drawable file ?有谁知道该怎么做吗?推荐答案得到一个位图 德codeResource(andro...
我想从位于我res的JPEG图像得到一个字节数组/绘制文件?
I would like to get a byte array from an jpeg image located in my res/drawable file ?
有谁知道该怎么做吗?
推荐答案
得到一个位图 德codeResource(android.content.res.Resources,INT)
然后,无论是COM preSS它ByteArrayOutputStream()或copyPixelsToBuffer,并从缓存阵列。
http://developer.android.com/reference/android/graphics/Bitmap.html
Get a bitmap decodeResource(android.content.res.Resources, int)
Then either compress it to ByteArrayOutputStream() or copyPixelsToBuffer and get your array from the buffer.
http://developer.android.com/reference/android/graphics/Bitmap.html
相关推荐
最新文章