读书人

getBit地图Byte

发布时间: 2012-08-22 09:50:35 作者: rapoo

getBitmapByte

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();}

读书人网 >PB

热点推荐