1

I am working on a Custom Image View in which you can control the radius of each corner individually.

The problem I am facing right now is that when I use canvas.drawPath(path, bitmapPaint), the image is scaled starting from top = 0 and left = 0 and scaled according to its aspect ratio.

I want to implement scale types for the the view, let's say I want to start from center crop.

I went through the Android image view implementation and got a little idea that I have to create scale and translate values. I have experience in 3D graphics and how texture works, so don't worry about how complicated the solution would be.

Following is the current output:

enter image description here

You can see how the image is getting stretched.

nayan dhabarde
  • 1,734
  • 1
  • 19
  • 38
  • 1
    You can override `setScaleType` method and set the imageView ScaleType you want. – GHH Nov 18 '19 at 03:58
  • Possible duplicate of [How set imageview scaletype to topCrop](https://stackoverflow.com/questions/29783358/how-set-imageview-scaletype-to-topcrop) – sanjeev Nov 18 '19 at 04:51
  • How set imageview scaletype to topCrop this is not working at all. No difference in the result I've got earlier and now – nayan dhabarde Nov 18 '19 at 13:24

0 Answers0