• inSampleSize计算

    public static int computeSampleSize(BitmapFactory.Options options,        int minSideLength, int maxNumOfPixel...

    Drawable、Bitmap、byte[]之间的转换

    1、Drawable → Bitmappublic static Bitmap drawableToBitmap(Drawable drawable) { Bitmap bitmap = Bitmap .createBitmap( ...

    java.lang.IllegalStateException: Immutable bitmap passed to Canvas constructor

    Bitmap bitmap = BitmapFactory.decodeResource(r, R.drawable.icon).copy(Bitmap.Config.ARGB_8888, true)加上.copy(Bitmap.Config.ARGB_8888, true)原因是如果不用copy的...