已經搜索了一段時間,似乎無法完成此操作。我(試圖)學習php-gd,但由於某種原因,即使使用隨時可用的代碼片斷,我在文件運行時得到的所有內容都是一個小的,可能是20x20px的框。通過phpinfo()查看;和GD運行良好,我似乎無法找到任何錯誤的代碼,任何想法?PHP GD - 空格
<?php
$redimg = imagecreatetruecolor(100, 100);
$image = imagecreatefrompng('overlay.png');
// sets background to red
$red = imagecolorallocate($redimg, 255, 0, 0);
imagefill($redimg, 0, 0, $red);
imagecopymerge($image, $redimg, 0, 0, 0, 0, 100, 100, 75);
header('Content-type: image/png');
imagepng($image);
imagedestroy($image);
imagedestroy($redimg);
?>
您的預期結果是什麼? – timclutton