0
//Get current dimensions
$width = imagesx($myimage);
$height = imagesy($myimage);
$width = $width * ($zoom/100);
$height = $height * ($zoom/100);
$scale = min($new_width/$width, $new_height/$height);
$new_width = ceil($scale * $width);
$new_height = ceil($scale * $height);
imagecopyresampled($image_p, $myimage, 0, 0, $offset_x * -1, $offset_y * -1, $new_width, $new_height, $width, $height);
我想放大的图片,但实际上它变得更小,而不是放大的。变焦就像100分之113= 1.13的系数应该在13%缩放放大的照片吗?
你为什么要计算规模有多大?通过相同的比例缩放两个尺寸应保持纵横。 –