Java tutorial
//package com.java2s; /* * COPYRIGHT NOTICE * Copyright (C) 2015, Jhuster <lujun.hust@gmail.com> * https://github.com/Jhuster/Android * * @license under the Apache License, Version 2.0 * * @file BitmapHelper.java * @brief Bitmap processor, include load,save,rotate,crop etc. * * @version 1.0 * @author Jhuster * @date 2015/11/20 */ import android.graphics.Bitmap; import android.graphics.Matrix; public class Main { public static Bitmap rotate(Bitmap bitmap, int degrees) { Matrix matrix = new Matrix(); matrix.postRotate(degrees); return Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); } }