对Bitmap 进行水平或者垂直的镜面翻转

Matrix m = new Matrix();
            if (i < 4)
                m.setScale(-1, 1);//水平翻转
            else
                m.setScale(1, -1);//垂直翻转
            int w = picture.getWidth();
            int h = picture.getHeight();
            //生成的翻转后的bitmap
            Bitmap reversePic = Bitmap.createBitmap(picture.getPictureBitmap(), 0, 0, w, h, m, true);

对Bitmap 进行水平或者垂直的镜面翻转_第1张图片
对Bitmap 进行水平或者垂直的镜面翻转_第2张图片

你可能感兴趣的:(日常记录)