Mirroring in cameraX

南笙酒味 提交于 2021-02-10 17:50:31

问题


How to show mirror image on both front and back facing camera mode.

I know that this bitmap can be mirrored like below

BitmapDrawable flip(BitmapDrawable d)
{
    Matrix m = new Matrix();
    m.preScale(-1, 1);
    Bitmap src = d.getBitmap();
    Bitmap dst = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), m, false);
    dst.setDensity(DisplayMetrics.DENSITY_DEFAULT);
    return new BitmapDrawable(dst);
}

But how to use it to implement mirroring for camera X

来源:https://stackoverflow.com/questions/64999859/mirroring-in-camerax

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!