zoukankan      html  css  js  c++  java
  • Matrix.postScale

     1   Matrix matrix = new Matrix();
     2             
     3             // 缩放图片动作
     4             matrix.postScale(scaleWidth, scaleHeight);
     5          // 创建新的图片
     6             Bitmap resizedBitmap = Bitmap.createBitmap(bitmapOrg, 0, 0,
     7             width, height, matrix, true);
     8          
     9            i1.setImageBitmap(resizedBitmap);
    10 
    11   // 缩放图片动作
    12             matrix.postScale(scaleWidth2, scaleHeight2);
    13 // 创建新的图片
    14           resizedBitmap = Bitmap.createBitmap(bitmapOrg2, 0, 0,
    15             width2, height2, matrix, true);
    16          
    17            i2.setImageBitmap(resizedBitmap);

    宽度上面会跟i1缩放的一样。
    如果new一个新的Matrix作用在imageview2上面得到的效果会是正确的。why?

  • 相关阅读:
    Day 9
    Day 8
    Day 7
    Day 6
    Day 5
    Day 4
    Day 3
    Day 2
    Day 1
    解决vue-cli3不停请求 /sockjs-node/info?t= 问题
  • 原文地址:https://www.cnblogs.com/anee/p/2729145.html
Copyright © 2011-2022 走看看