$url = '99.png';
$im = imagecreatefromstring(file_get_contents($url));
$w = imagesx($im);
$h = imagesy($im);
$c = imagecolorallocate($im, 255, 0, 0);
imagearc($im, $w/2, $h/2, $w, $h, 0, 360, $c);
imagefilltoborder($im, 0, 0, $c, $c);
imagefilltoborder($im, $w, 0, $c, $c);
imagefilltoborder($im, 0, $h, $c, $c);
imagefilltoborder($im, $w, $h, $c, $c);
imagecolortransparent($im, $c); //!!!!
$dm = imagecreatefromstring(file_get_contents('4.jpg'));
imagecopymerge($dm, $im, 160, 50, 0, 0, $w, $h, 100);
header("Content-type: image/png");
imagepng($dm);
PHP 图片设置圆角
最新推荐文章于 2023-05-23 08:55:48 发布