Resize an image and fill gaps of proportions with a color

前端 未结 2 1685
一整个雨季
一整个雨季 2021-02-11 02:51

I am uploading logos to my system, and they need to fix in a 60x60 pixel box. I have all the code to resize it proportionately, and that\'s not a problem.

My 454x292px i

2条回答
  •  你的背包
    2021-02-11 03:16

    http://php.net/manual/en/function.imagecopyresampled.php

    That's basically the function you want to copy and resize it smoothly.

    http://www.php.net/manual/en/function.imagecreatetruecolor.php

    With that one you create a new black image.

    http://www.php.net/manual/en/function.imagefill.php

    That part explains how to fill it white.

    The rest follows.

提交回复
热议问题