Scale & rotate Bitmap using Matrix in Android

前端 未结 8 1729
名媛妹妹
名媛妹妹 2020-12-12 19:26

I\'m trying to scale and rotate in single operation before creting the final bitmap but the preRotate, postConcat doesn\'t seem to work.

Bitmap bmp = ... ori         


        
8条回答
  •  自闭症患者
    2020-12-12 20:10

    Matrix rotateMatrix = new Matrix();
    rotateMatrix.postRotate(rotation);
    rotatedBitmap = Bitmap.createBitmap(loadedImage, 0, 0,loadedImage.getWidth(), loadedImage.getHeight(),rotateMatrix, false);
    

提交回复
热议问题