【问题标题】:ImageView rotation working fine, but still distortion in graphicImageView 旋转工作正常,但图形仍然失真
【发布时间】:2011-09-09 22:22:42
【问题描述】:

我的代码在 ImageView 的旋转中运行良好。但旋转后的 ImageView 变得扭曲/清晰,并且看起来很模糊。

arrow1 = (ImageView) findViewById(R.id.arrow1); 位图 = BitmapFactory.decodeResource(getResources(), R.drawable.arrow1); bmpWidth = bitmap.getWidth(); bmpHeight = bitmap.getHeight(); 浮动 curScale = 1F; 矩阵矩阵 = 新矩阵(); matrix.postScale(curScale, curScale); 矩阵.postRotate(90); if(resizedBitmap!=null){ resizedBitmap.recycle(); } resizedBitmap = Bitmap.createBitmap(bitmap, 0, 0, bmpWidth, bmpHeight, matrix, true); arrow1.setImageBitmap(resizedBitmap);

【问题讨论】:

    标签: java android


    【解决方案1】:

    您是否特别限于上面使用过的课程,即这是一项学术练习吗?

    似乎有很多方法可以实现无损 90 度旋转,但没有一种方法像您一样使用 ImageView 和 Matrix。

    只是说“Google it”有点意思,但实际上,你好像没有这样做。

    http://www.google.co.uk/search?q=image+rotate+90+degrees+java

    【讨论】:

      猜你喜欢
      • 2012-06-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-02-16
      • 1970-01-01
      • 2020-07-07
      • 2023-03-19
      相关资源
      最近更新 更多