在使用Bitmap对象时,应该在使用完毕后及时释放资源,并设置为null。
示例代码:
Bitmap bitmap = BitmapFactory.decodeFile(filePath); // 使用完毕后释放资源 if(bitmap!=null){ bitmap.recycle(); bitmap = null; }
上一篇:bitmap的`premultiplied`变量是什么?
下一篇:BitmapEncoder.CreateForTranscoding破坏PNG图像。