当我称这种代码安静时,我的位图会失去质量并变得模糊
public static Bitmap rotateBitmap( Bitmap source, double rotation ) {
// No rotation specified, just return the original
if ( rotation == 0.0 ) return ( source );
try {
// Setup the matrix for translation
Matrix matrix = new Matrix();
matrix.reset();
if (source.getWidth() > source.getHeight())
matrix.postRotate( (float)rotation );
// Rotate the bitmap
Bitmap rotatedBitmap = Bitmap.createBitmap( source, 0, 0, source.getWidth(), source.getHeight(), matrix, false );
return ( rotatedBitmap );
}
catch ( Exception e ) {
return ( null );
}
}