首页 > 其他 > 详细

bitmap1 = bitmap2导致bitmap1不能使用一致报回收错误解决

时间:2015-11-10 19:08:05      阅读:239      评论:0      收藏:0      [点我收藏+]
public Bitmap createCanNotRecycleBitmap(Bitmap bitmap) {
int fgWidth = bitmap.getWidth();
int fgHeight = bitmap.getHeight();
//create the new blank bitmap 创建一个新的和SRC长度宽度一样的位图
Bitmap newbmp = Bitmap.createBitmap(fgWidth, fgHeight, Bitmap.Config.ARGB_8888);
Canvas cv = new Canvas(newbmp);

//draw fg into
cv.drawBitmap(bitmap, new Rect(0,0,fgWidth,fgHeight), new Rect(0,0,fgWidth,fgHeight), null);//在 0,0坐标开始画入fg ,可以从任意位置画入
//save all clip
cv.save(Canvas.ALL_SAVE_FLAG);//保存
//store
cv.restore();//存储
return newbmp;
}

bitmap1 = bitmap2导致bitmap1不能使用一致报回收错误解决

原文:http://www.cnblogs.com/visuals/p/4953914.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!