码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-11-10 19:08:39      阅读:255      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!