畫(huà)布可以正常輸出,但是谷歌瀏覽器的背景是黑色的<?php
/**
?*?Created?by?PhpStorm.
?*?User:?hasee
?*?Date:?2018/4/23
?*?Time:?17:20
?*/
//創(chuàng)建畫(huà)布
//imagecreatetruecolor($width,$height);創(chuàng)建畫(huà)布,返回資源,返回圖像標(biāo)識(shí)符;
$image=imagecreatetruecolor(500,500);
//創(chuàng)建顏色
$red=imagecolorallocate($image,255,0,0);
//橫著寫(xiě)一個(gè)字符
imagechar($image,5,50,100,'k',$red);
//以圖片的形式顯示到瀏覽器
header('content-type:image/jpeg');
//輸出圖像
imagejpeg($image);
//銷毀資源
imagedestroy($image);
- 2 回答
- 0 關(guān)注
- 1537 瀏覽
添加回答
舉報(bào)
0/150
提交
取消