• php图片等比例缩放


    <?php
    $filename="./test1.jpg";
    $per=0.5;
    list($width, $height)=getimagesize($filename);
    $n_w=$width*$per;
    $n_h=$height*$per;
    $new=imagecreatetruecolor($n_w, $n_h);
    $img=imagecreatefromjpeg($filename);
    //copy部分图像并调整
    imagecopyresized($new, $img,0, 0,0, 0,$n_w, $n_h, $width, $height);
    //图像输出新图片、另存为
    imagejpeg($new, "./test11.jpg");
    imagedestroy($new);
    imagedestroy($img);
    ?>

  • 相关阅读:
    愤怒的小鸟(angry bird )
    1101模拟
    1029模拟题解
    1028题解
    图床
    数据结构
    博弈论
    差分
    前缀和
    快读和快写
  • 原文地址:https://www.cnblogs.com/leku_cc/p/7452592.html
Copyright © 2020-2023  润新知