【php开源代码栏目提醒】:网学会员--在 php开源代码编辑为广大网友搜集整理了:imagebiger.php绩等信息,祝愿广大网友取得需要的信息,参考学习。
<?php
// 图片的名称
$imgfile = 'peng.jpg';
//为原来图像的1.5倍大小
$x = 1.5;
//获取图片的宽度和高度
list($width, $height) = getimagesize($imgfile);
//缩放后的高度和宽度
$newwidth = $width * $x;
$newheight = $height * $x;
//重新组合图片
$thumb = ImageCreateTrueColor($newwidth,$newheight);
$source = imagecreatefromjpeg($imgfile);
//输出图片
imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
header('Content-type: image/jpeg');
//清除资源
imagejpeg($thumb);
?>