rotate.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (i >= 360) {
i = 0;
}
i = i + 90;
Matrix mat = new Matrix();
mat.preRotate(i);// /in degree
// Bitmap
mBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),
bitmap.getHeight(), mat, true);
mImageView.setImageBitmap(mBitmap);
}
});
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
if (i >= 360) {
i = 0;
}
i = i + 90;
Matrix mat = new Matrix();
mat.preRotate(i);// /in degree
// Bitmap
mBitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(),
bitmap.getHeight(), mat, true);
mImageView.setImageBitmap(mBitmap);
}
});
No comments:
Post a Comment