调整存储在文件夹中的图像的大小

时间:2013-05-27 09:38:21

标签: image-resizing powerpoint-vba

我想从文件夹中取出一张图片来调整它的大小并将其存储在同一位置,并使用相同的名称。我看了很多关于如何拍摄图像,调整大小并将其放在powerpoint幻灯片中的示例,但我只想将其存储在文件夹而不是演示文稿中。这可能吗?

1 个答案:

答案 0 :(得分:0)

使用Imagejpeg。

这可以调整jpeg的大小。它被写成将$ content作为来自数据库的提要 - 只需替换为你希望调整大小的iread的fread()。

$newheight=floor($newheight);
$newwidth=floor($newwidth); 
$image=imagecreatefromstring($content);
$newimage=imagecreatetruecolor($newwidth, $newheight);
imagecopyresampled($newimage, $image, 0, 0, 0, 0, $newwidth, $newheight,$row['width'], $row['height']);
imagejpeg($newimage,$filetosaveto);
相关问题