'arial.ttf', // font 'fontpath'=>PATH_CORE.'/plugins/', // polozenie pliku z fontem 'image'=>'captcha1.png', // nazwa obrazka typu PNG uzywanego jako background 'light'=>0, // jasnosc napisu, 100=bialy, 0=czarny 'saturation'=>90, // nasycenie koloru napisu, 0=szary, 100=najbardziej nasycony 'alpha'=>60, // przezroczystosc napisu, 0=bez przezroczystosci, 100=calkowicie transparentny 'imageheight'=>60, 'imagewidth'=>160 ); putenv('GDFONTPATH=' . realpath($config['fontpath'])); //$im = imagecreatefrompng($config['image']); $im = imagecreatetruecolor($config['imagewidth'], $config['imageheight']); if ($im) { $white = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, $config['imagewidth'], $config['imageheight'], $white); $maxfontheight=$config['imageheight']*0.7; $minfontheight=$config['imageheight']*0.4; $px = ($config['imagewidth']-20)/(strlen($string)); header('Content-Type: image/png'); header('Cache-control: no-cache, no-store'); $textcolor=mt_rand(0, 359); for ($i=0; $i<20; $i++) { $rgb=hls2rgb(mt_rand($textcolor+20, $textcolor+319),60,$config['saturation']); $color = imagecolorallocatealpha($im, $rgb[0], $rgb[1],$rgb[2],$config['alpha']); $angle=mt_rand(-15, 15); $fontheight=mt_rand($minfontheight/2, $minfontheight); $posx=mt_rand(0, $config['imagewidth']); $posy=mt_rand($fontheight, $config['imageheight']); imagettftext( $im, $fontheight, $angle, $posx, $posy, $color, realpath($config['fontpath']).'/'.$config['font'], chr(mt_rand(ord('A'),ord('Z'))) ); } $rgb=hls2rgb($textcolor,$config['light'],$config['saturation']); $color = imagecolorallocatealpha($im, $rgb[0], $rgb[1],$rgb[2],$config['alpha']); for ($i=0; $i