关于使用Matrix进行图片旋转的问题
zzmei 2011-07-13 12:58:33 this.degree += degree;
Matrix matrix = new Matrix();
matrix.setRotate( this.degree );
Bitmap tmpBitmap = Bitmap.createBitmap( this.bitmap, 0, 0, this.w, this.h, matrix, true );
BitmapDrawable bitmapDrawable = new BitmapDrawable( tmpBitmap );
this.imageView.setImageDrawable( bitmapDrawable );
使用上面的代码对图片进行旋转时,图片的大小会变,怎样才能让图片只旋转而大小不变?
this.imageView:图片对应的ImageView对象
degree:本次旋转的角度
this.w:原始图片的宽度
this.h:原始图片的高度