开发者

ImageView not rotating

ImageView is not rotating ?

ImageView arrow1;
arrow1  =(ImageView) findViewById(R.id.arrow1);
Matrix mtx =开发者_JS百科 new Matrix();
mtx.postRotate(90);
arrow1.setImageMatrix(mtx);

Any Suggestions?


Now Image rotating

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);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜