Is it possible to resize by pulling the matrix on the 4 side of the view? I can resize from a single point to a ratio like this.
The example above works as follows:
protected boolean onTouchDown(@NonNull MotionEvent event) {
oldDistance = (float) Math.sqrt((midPoint.x-event.getX()) * (midPoint.x-event.getX()) + (midPoint.y-event.getY()) * (midPoint.y-event.getY()));
...
}
float newDistance = (float) Math.sqrt((midPoint.x-event.getX()) * (midPoint.x-event.getX()) + (midPoint.y-event.getY()) * (midPoint.y-event.getY()));
moveMatrix.set(downMatrix);
moveMatrix.postScale(newDistance / oldDistance, newDistance / oldDistance, midPoint.x,
midPoint.y);
handlingSticker.setMatrix(moveMatrix);
But, for example, how can I make the process of expanding on the right side like below pictures with matrix?
handlingSticker
is a ImageView ? what is the type ? – Gluttonous