Code example for Matrix

Methods: createBitmap, preRotate

0
				// Getting width & height of the given image. 
				int w = bitmap.getWidth(); 
				int h = bitmap.getHeight(); 
 
				// Setting pre rotate 
				Matrix mtx = new Matrix(); 
				mtx.preRotate(rotate); 
 
				// Rotating Bitmap 
				bitmap = Bitmap.createBitmap(bitmap, 0, 0, w, h, mtx, false); 
			} 
 
			// Convert to ARGB_8888, required by tess 
			bitmap = bitmap.copy(Bitmap.Config.ARGB_8888, true); 
 
		} catch (IOException e) { 
			Log.e(TAG, "Couldn't correct orientation: " + e.toString()); 
		} 
 
		// _image.setImageBitmap( bitmap );