Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我尝试用 php 创建空白图像,这是我的代码
$bg = imagecreatetruecolor(120, 20); imagejpeg($bg,"test/myimg.jpg",100);
但这创建了黑色图像,我想创建白色,请告诉如何设置图像,例如白色?
<?php $img = imagecreatetruecolor(120, 20); $bg = imagecolorallocate ( $img, 255, 255, 255 ); imagefilledrectangle($img,0,0,120,20,$bg); imagejpeg($img,"myimg.jpg",100); ?>