相关疑难解决方法(0)

Android:以一定角度在imageview中旋转图像

我使用以下代码在ImageView中旋转图像一个角度.有没有更简单,更简单的方法可用.

ImageView iv = (ImageView)findViewById(imageviewid);
TextView tv = (TextView)findViewById(txtViewsid);
Matrix mat = new Matrix();
Bitmap bMap = BitmapFactory.decodeResource(getResources(),imageid);
mat.postRotate(Integer.parseInt(degree));===>angle to be rotated
Bitmap bMapRotate = Bitmap.createBitmap(bMap, 0, 0,bMap.getWidth(),bMap.getHeight(), mat, true);
iv.setImageBitmap(bMapRotate);
Run Code Online (Sandbox Code Playgroud)

android bitmap rotation imageview

147
推荐指数
9
解决办法
28万
查看次数

标签 统计

android ×1

bitmap ×1

imageview ×1

rotation ×1