关于android处理大位图的问题
很无语的事情,昨天碰到了200x1000的位图,然后我把这个位图用
public static Bitmap preScaleBitmap(Bitmap temp, float drawScale) { float scaleWidth = DataManager.deviceWidth - 20; // float scaleHeight=(int)((DataManager.deviceWidth-20)*drawScale); float scale = scaleWidth / temp.getWidth(); Matrix matrix = new Matrix(); matrix.postScale(scale, scale); // matrix.postScale(0.5f, 0.5f); Bitmap temp2 = Bitmap.createBitmap(temp, 0, 0, temp.getWidth(), temp.getHeight(), matrix, true); return temp2; }