Hello Friends today we will see how to flip bitmap in android.
//# create a enum flip type parameter.
Support by downloading my App!
//# create a enum flip type parameter.
// flip function with typeenum FLIP{HORIZONTAL,VERTICAL};
// calling flip function and get flipped bitmappublic static Bitmap flip(Bitmap bitmap, FLIP type){Matrix matrix =new Matrix();if(type==FLIP.HORIZONTAL){matrix.preScale(-1.0f, 1.0f);}else if(type==FLIP.VERTICAL){matrix.preScale(1.0f, -1.0f);}return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true);}
Bitmap flippedBitmap=flip(bitmap, FLIP.HORIZONTAL);
Support by downloading my App!