Friday, 7 December 2012

How to flip and rotate Image

Write the following code in your java file to flip and rotate image  
int rotation=90;
matrix=new Matrix();
matrix.postScale(-1F,1F);// For the flip image set -1F
matrix.postRotate(rotation);//rotate image in 90 degree
try
{
              cameraBitmap=Bitmap.createBitmap(cameraBitmap,0,0,cameraBitmap.getwidth(),
              cameraBitMap.getHeight(),matrix,true);
}
catch(OutofMemoryError e)
{
     e.printStackTrace();
}

No comments:

Post a Comment