calculate the scale rate to shrink the image and adjust the size of the ...

...image