$image = imagecreatetruecolor(200, 60); $background = imagecolorallocate($image, 255, 255, 255); imagefill($image, 0, 0, $background);
for ($i=0; $i < 300; $i++) {
$pixColor = imagecolorallocate($image, rand(150, 240), rand(150, 240), rand(150, 240));
$pixX = rand(10, 190);
$pixY = rand(5, 55);
imagesetpixel($image, $pixX, $pixY, $pixColor);
}
//4条水平线
for ($i=0; $i < 5; $i++) {
$lineColor = imagecolorallocate($image, rand(50, 150), rand(50, 150), rand(50, 150));
$lineX1 = 0;
$lineX2 = 300;
$lineY1 = ($i + 1) * 12;
$lineY2 = ($i + 1) * 12;
imageline($image, $lineX1, $lineY1, $lineX2, $lineY2, $lineColor);
}
//10条垂直线
for ($i=0; $i < 30; $i++) {
$lineColor = imagecolorallocate($image, rand(50, 150), rand(50, 150), rand(50, 150));
$lineX1 = ($i + 1) * 10;
$lineX2 = ($i + 1) * 10;
$lineY1 = 0;
$lineY2 = 60;
imageline($image, $lineX1, $lineY1, $lineX2, $lineY2, $lineColor);
}
$text = array('栀', '子', '花', '开');
for ($i=0; $i < 4; $i++) {
$textColor = imagecolorallocate($image, rand(20, 100), rand(20, 100), rand(20, 100));
$textX = $i * 50 + 10;
$textY = rand(40, 60);
imagettftext($image, 30, rand(20, 50), $textX, $textY, $textColor, "/Library/Fonts/华文仿宋.ttf", $text[$i]);
}
header("Content-Type:image/png");
imagepng($image);
imagedestroy($image);
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有