Skip to content

Instantly share code, notes, and snippets.

@Hajto
Created December 13, 2015 14:24
Show Gist options
  • Save Hajto/2a1258fc950653f7b237 to your computer and use it in GitHub Desktop.
Save Hajto/2a1258fc950653f7b237 to your computer and use it in GitHub Desktop.
public static Bitmap flipHorizontallu(Bitmap bmp){
Matrix matrix = new Matrix();
matrix.postScale(-1.0f, 1.0f);
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
}
public static Bitmap flipVertically(Bitmap bmp){
Matrix matrix = new Matrix();
matrix.postScale(1.0f, -1.0f);
return Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(), bmp.getHeight(), matrix, true);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment