问题
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