public Bitmap rotate(Bitmap bitmap, int degrees) {
if (degrees != 0 && bitmap != null) {
Matrix m = new Matrix();
m.setRotate(degrees, (float) bitmap.getWidth() / 2, (float) bitmap.getHeight() / 2);
try {
Bitmap converted = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), m, true);
if (bitmap != converted) {
bitmap.recycle();
bitmap = converted;
}
} catch (OutOfMemoryError ex) {
// ¸Þ¸ð¸®°¡ ºÎÁ·ÇÏ¿© ȸÀüÀ» ½ÃÅ°Áö ¸øÇÒ °æ¿ì ±×³É ¿øº»À» ¹ÝȯÇÕ´Ï´Ù.
}
}
return bitmap;
}
* ±ÛÀ» µî·ÏÇϽǶ§ ²À ÇÊ¿äÇÑ °æ¿ì°¡ ¾Æ´Ï¸é °³ÀÎÁ¤º¸¸¦ ³²±âÁö ¸¶¼¼¿ä ^^ (¿¬¶ôó,À̸ÞÀÏÁÖ¼Ò,Áֹεî·Ï¹øÈ£ µî)