ImageView
不旋轉?ImageView不旋轉
ImageView arrow1;
arrow1 =(ImageView) findViewById(R.id.arrow1);
Matrix mtx = new Matrix();
mtx.postRotate(90);
arrow1.setImageMatrix(mtx);
有什麼建議嗎?
ImageView
不旋轉?ImageView不旋轉
ImageView arrow1;
arrow1 =(ImageView) findViewById(R.id.arrow1);
Matrix mtx = new Matrix();
mtx.postRotate(90);
arrow1.setImageMatrix(mtx);
有什麼建議嗎?
現在圖片旋轉 – 2011-06-07 09:26:33
接受答案,如果它是正確的 – Lavanya 2011-06-07 10:03:13
現在,圖像旋轉
arrow1 = (ImageView) findViewById(R.id.arrow1);
bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.arrow1);
bmpWidth = bitmap.getWidth();
bmpHeight = bitmap.getHeight();
float curScale = 1F;
Matrix matrix = new Matrix();
matrix.postScale(curScale, curScale);
matrix.postRotate(90);
if(resizedBitmap!=null){
resizedBitmap.recycle();
}
resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bmpWidth, bmpHeight, matrix, true);
arrow1.setImageBitmap(resizedBitmap);
沒有ü嘗試嗎? – Lavanya 2011-06-06 10:58:57
如果我需要像postRotate(102)那樣以不同的角度旋轉圖像。 – 2011-09-17 07:29:07