[求助]php生成图片 |
刚学了用php生成图片,就照着别人的例子做了一个生成验证码图片,
可是不知是什么原因,调出来的验证码根本看不清。我想仅仅是让别人看清楚而已,和美术功底没关系。各位能给我调调吗?下面是程序代码:
<?php
Header("Content-type: image/PNG");
srand((double)microtime()*1000000);
$im = @imagecreate(62,20);
$black = @ImageColorAllocate($im, 0,0,0);
$white = @ImageColorAllocate($im, 255,255,255);
$gray = @ImageColorAllocate($im, 200,200,200);
@imagefill($im,68,30,$gray);
//将四位整数验证码绘入图片
@imagestring($im,5,10,3,$_GET['authnum'],$black);
for($i=0;$i<200;$i++){
$randcolor = @ImageColorallocate($im,rand(0,255),rand(0,255),rand(0,255));
@imagesetpixel($im,rand()%70 ,rand()%70,$randcolor);
}
@ImagePNG($im);
@ImageDestroy($im);
?> |
|
|