You do not need to use any library, you can try a simple function to view the image in horizontal or vertical direction,
final static int FLIP_VERTICAL = 1; final static int FLIP_HORIZONTAL = 2; public static Bitmap flip(Bitmap src, int type) { // create new matrix for transformation Matrix matrix = new Matrix(); // if vertical if(type == FLIP_VERTICAL) { matrix.preScale(1.0f, -1.0f); } // if horizonal else if(type == FLIP_HORIZONTAL) { matrix.preScale(-1.0f, 1.0f); // unknown type } else { return null; } // return transformed image return Bitmap.createBitmap(src, 0, 0, src.getWidth(), src.getHeight(), matrix, true); }
You will need to transfer the bitmap associated with the reversal of the image so that it is flipped and flipped. For instance,
ImageView myImageView = (ImageView) findViewById(R.id.myImageView); Bitmap bitmap = ((BitmapDrawable)myImageView.getDrawable()).getBitmap(); // get bitmap associated with your imageview myImageView .setImageBitmap(flip(bitmap ,FLIP_HORIZONTAL));
source share