问题描述
|
我要放大图像,同时要保持比例不变
解决方法
$blob = mysql_fetch_...();
$gd = imagecreatefromstring($blob);
$resized = imagecreatetruecolor(X,Y); // new image dimensions
imagecopyresampled(....);
ob_start();
imagejpeg($resized);
$new_blob = ob_get_clean();
mysql_query(... update table ...);
,那里有无数的图像调整大小脚本(Google关键字:php thumbnailer)。也可以使用GD自己滚动。将Blob加载到字符串中,然后使用imagecreatefromstring()函数创建图像。