Php plotting & lt ;? Phpheader ("content-type: image/png"); $ img & nbsp; = & nbsp; imagecreate (85, & nbsp; 27); imagecolorallocatealpha ($ img, & nbsp; 127, & n php drawing problems
header("content-type:image/png");
$img = imagecreate(85, 27);
imagecolorallocatealpha($img, 127, 127, 127, 0);
imagepng($img);
//imagedestroy($img);
?>
The result is a cross. ask the answer. what is the problem.
------ Best solution --------------------
Add
Error_reporting (E_ALL &~ (E_STRICT
------ Other solutions --------------------
I found that I can see a gray rectangle here. it's not that your gd library is not open.
------ Other solutions --------------------
In addition to the code you have posted, this php file cannot contain any other code. Otherwise, an error occurs.
Because the final HTML code format is:
------ Other solutions --------------------
Reference:
In addition to the code you have posted, this php file cannot contain any other code. Otherwise, an error occurs.
Because the final HTML code format is:
The whole page only has the above code. Nothing else can be displayed in a file.
------ Other solutions --------------------
Reference:
I found that I can see a gray rectangle here. it's not that your gd library is not open.
I don't know. I can only save it and cannot directly output it to the page. You can show that I have not tried WINIDOW in LINUX. what about you?
------ Other solutions --------------------
The encoding of the file. Removed the BOM header.
------ Other solutions --------------------
Reference:
The encoding of the file. Removed the BOM header.
UTF-8 coding,
------ Other solutions --------------------
Confirm that there is no BOM header. use the editor to save it in UTF-8 without bom format.
------ Other solutions --------------------
Reference:
Confirm that there is no BOM header. use the editor to save it in UTF-8 without bom format.
I keep saving it like this.
------ Other solutions --------------------
Yes?> Try again
------ Other solutions --------------------
E_NOTICE ));
Check whether an error is reported? Is the GD Library not enabled?