1.
cropBitmap.copy(Bitmap.Config.ARGB_8888, true);
cropBitmap.compress(Bitmap.CompressFormat.PNG, 100, bos);//格式要为png
2.
private Bitmap getBitmap(Bitmap bitmap){
Bitmap newBitmap = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(newBitmap);
canvas.drawColor(Color.TRANSPARENT);
Paint paint = new Paint();
canvas.drawBitmap(bitmap, 0, 0, paint);
return newBitmap;
} bug A/Bitmap: Error, cannot access an invalid/free'd bitmap here!
A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 12532 (isdom.chengguan)
Bitmap: Called getHeight() on a recycle()'d bitmap! This is undefined behavior!
bitmap.recycle();的问题
https://blog.csdn.net/sted_zxz/article/details/78262671
05-11 22:36