-1

当我使用 php gd 库裁剪 png 图像时,它以一种奇怪的方式裁剪。因为它被部分裁剪。我认为透明度无法正常工作。

这是我的代码

      imagesavealpha($this->image, true);
      $bg = imagecolorallocatealpha($this->image, 0, 0, 0, 127);
      imagefill($this->image, 0, 0, $bg);
      imagepng($this->image,$filename);
4

1 回答 1

1

听起来您好像给新图像提供了错误的尺寸。

你如何裁剪图像?imagecopyresampled? http://php.net/manual/en/function.imagecopyresampled.php

于 2011-01-24T12:34:06.910 回答