background image

$imstr

[0]["x"] = rand(2,5);

$imstr

[0]["y"] = rand(1,4);

//获取第 2 个随机文字
//$imstr[1]["s"] = $Str[rand(0,2)][rand(0,25)];

$imstr

[1]["x"] = 

$imstr

[0]["x"]+

$font_size

-1+rand(0,1);

$imstr

[1]["y"] = rand(1,3);

//获取第 3 个随机文字
//$imstr[2]["s"] = $Str[rand(0,2)][rand(0,25)];

$imstr

[2]["x"] = 

$imstr

[1]["x"]+

$font_size

-1+rand(0,1);

$imstr

[2]["y"] = rand(1,4);

//获取第 4 个随机文字
//$imstr[3]["s"] = $Str[rand(0,2)][rand(0,25)];

$imstr

[3]["x"] = 

$imstr

[2]["x"]+

$font_size

-1+rand(0,1);

$imstr

[3]["y"] = rand(1,3);

//写入随机字串

for

(

$i

=0;

$i

<4;

$i

++){

//获取随机较深颜色

$text_color

 = imagecolorallocate(

$im

,rand(80,180),rand(80,180),rand(80,180));

//画文字

imagechar(

$im

,

$font_size

,

$imstr

[

$i

]["x"],

$imstr

[

$i

]["y"],

$imstr

[

$i

]["s"],

$text_color

);

}

//显示图片

imagepng(

$im

);

//销毁图片

imagedestroy(

$im

);

exit

;

else

 {

header("Pragma:no-cache");
header("Cache-control:no-cache");
header("ContentType: Image/BMP");

$Color

[0] = 

chr

(0).

chr

(0).

chr

(0);

$Color

[1] = 

chr

(255).

chr

(255).

chr

(255);

$_Num

[0] = 

"11100001111101111011110111101111010010111101001011110100101111010010111101111011
11011110111110000111";

$_Num

[1] = 

"11110111111100011111111101111111110111111111011111111101111111110111111111011111111
10111111100000111";

$_Num

[2] = 

"1110000111110111101111011110111111111011111111011111111011111111011111111011111111
011110111100000011";

$_Num

[3] =