首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > PB >

getBit地图Byte

2012-08-22 
getBitmapBytepublic byte[] getBitmapByte(Drawable drawalbe) {BitmapDrawable db (BitmapDrawable) d

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

热点排行