public byte[] getBitmapByte(Drawable drawalbe) {
BitmapDrawable db = (BitmapDrawable) drawalbe;
Bitmap bitmap = db.getBitmap();
ByteArrayOutputStream out = new ByteArrayOutputStream();
bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);
try {
out.flush();
out.close();
} catch (IOException e) {
e.printStackTrace();
}
return out.toByteArray();
}
getBitmapByte
最新推荐文章于 2022-10-08 17:10:47 发布