您的位置:首页 > 其它

读取sd卡下图片,由图片路径转换为bitmap

2016-03-09 12:31 169 查看
其中w和h你需要转换的大小

path转换为bitmap:上面方法即可;
imageview获取drawable并转换为 bitmap :Bitmap bt= ((BitmapDrawable) mImageview.getDrawable()).getBitmap();

resourceid转换为bitmap:Bitmap bt = BitmapFactory.decodeResource(getResources(), R.drawable.resourceid);

Drawable转换为bitmap:Bitmap bt= ((BitmapDrawable) Drawable).getBitmap();
因为BitmapDrawable是继承Drawable,所以可以灵活的转换
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: