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

来源:互联网 发布:复利的威力 知乎 编辑:程序博客网 时间:2024/05/17 03:57
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);

水平翻转前
翻转后

0 0
原创粉丝点击