php创建图片后,如何设置背景为白色?
Header("Content-type:image/png");$im=imagecreate(620,580);
之后,就是黑色背景,我想要白色背景,如何设置? 多看PHP手册
<?php
header("Content-type: image/png");
$im = @imagecreate(100, 50)
or die("Cannot Initialize new GD image stream");
// 设置背景颜色...
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5,"A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
页:
[1]