In android, the position of the ImageView is determined by the upper left of the image. I assume that the x direction is 1/3 of the width from the starting point. Now we can install the rod. Basically, the location of the pivot point is the location around which the view will rotate and scale.
int displacementX = ImageView.getWidth() / 3; int displacementY = 10; imgview.setPivotX((float)displacementX); imgview.setPivotY((float)displacementY);
Now that we have set the anchor point, we can use the scale type to match the image.
imgview.setScaleType(ImageView.ScaleType.CENTER_CROP);
source share