Closed ps130183 closed 6 years ago
问题指向shapeImageView 中的 drawDrawable()方法 的 bitmap缩放的时候。 //Bitmap缩放 float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); canvas.drawBitmap(bitmap, 0, 0, paint); canvas.restore();
ShapeImageView是有问题的也不是好的办法,在GlideImageView V2.0.0版本中去掉了,欢迎测试体验
问题指向shapeImageView 中的 drawDrawable()方法 的 bitmap缩放的时候。 //Bitmap缩放 float scaleWidth = ((float) getWidth()) / bitmap.getWidth(); float scaleHeight = ((float) getHeight()) / bitmap.getHeight(); Matrix matrix = new Matrix(); matrix.postScale(scaleWidth, scaleHeight); bitmap = Bitmap.createBitmap(bitmap, 0, 0, bitmap.getWidth(), bitmap.getHeight(), matrix, true); canvas.drawBitmap(bitmap, 0, 0, paint); canvas.restore();