ビューをビットマップに転送し、以下の方法を使用して反転します。
private static Bitmap getBitmapFromView(View view,int width,int height) {
int widthSpec = View.MeasureSpec.makeMeasureSpec(width, View.MeasureSpec.EXACTLY);
int heightSpec = View.MeasureSpec.makeMeasureSpec(height, View.MeasureSpec.EXACTLY);
view.measure(widthSpec, heightSpec);
view.layout(0, 0, width, height);
Bitmap bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
Canvas canvas = new Canvas(bitmap);
view.draw(canvas);
return bitmap;
}
private static Bitmap flipBitmap(Bitmap src)
{
Matrix matrix = new Matrix();
matrix.preScale(-1, 1);
Bitmap dst = Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, false);
dst.setDensity(DisplayMetrics.DENSITY_DEFAULT);
return dst;
}