0
我已經寫了下面的一組代碼的編輯圖像。如何使用PHP
$image = ImageCreate(200, 50);
$background_color = ImageColorAllocate($image, 255, 255, 255); // white
$gray = ImageColorAllocate($image, 204, 204, 204); // gray
ImageFilledRectangle($image, 50, 10, 150, 40, $gray);
header('Content-type: image/png');
ImagePNG($image);
同時運行此代碼我得到一個錯誤
The image "http://localhost/app/" cannot be displayed because it contains errors.
請幫助我。
沒有數據'運行從終端/命令行或在瀏覽器這個code'? – hjpotter92
@閃回:在瀏覽器中運行 –
似乎對我來說工作正常。 – hjpotter92