ImageUtil.java 文件源码

java
阅读 38 收藏 0 点赞 0 评论 0

项目:FaceRecognition 作者:
public static Bitmap convert(Bitmap a) {
    int w = a.getWidth();
    int h = a.getHeight();
    Bitmap newb = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);// 创建一个新的和SRC长度宽度一样的位图
    Canvas cv = new Canvas(newb);
    Matrix m = new Matrix();
    //m.postScale(1, -1);   //镜像垂直翻转
    m.postScale(-1, 1);   //镜像水平翻转
    //m.postRotate(-90);  //旋转-90度
    Bitmap new2 = Bitmap.createBitmap(a, 0, 0, w, h, m, true);
    cv.drawBitmap(new2, new Rect(0, 0, new2.getWidth(), new2.getHeight()),new Rect(0, 0, w, h), null);
    return newb;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号