// 图片剪切
    public static Bitmap cutBitmap(Bitmap mBitmap, Rect r, Bitmap.Config config) {
        int width = r.width();
        int height = r.height();

        Bitmap croppedImage = Bitmap.createBitmap(width, height, config);

        Canvas cvs = new Canvas(croppedImage);
        Rect dr = new Rect(0, 0, width, height);
        cvs.drawBitmap(mBitmap, r, dr, null);
        return croppedImage;
    }

 

相关文章: