// Рисуем цифры $pole_wid = intval($captcha->Width / $num_chars); for ($i = 0; $i < $num_chars; ++$i) { $c = $code[$i]; $x = $char_width * $c + $c + 1; $posx = rand($pole_wid * $i + 1, $pole_wid * $i + $pole_wid - $char_width - 1) + rand(-1, 1); if ($posx < 0) { $posx = 0; } elseif ($posx > $captcha->Width - $char_width) { $posx = $captcha->Width - $char_width; } $posy = rand(3, $captcha->Height - $char_height - 3); $captcha->Copy($font, $x, 1, 10, $char_height, $posx, $posy); } // Рисуем капчу $result_image->Draw($captcha->gd, ($result_width - $captcha_width) / 2, 5); // Искажение $result_MultiWave = new TPicture(); $result_MultiWave->NewPicture($result_width, $captcha_height, IMAGE_PNG); imagealphablending($result_MultiWave->gd, true); imagecolortransparent($result_MultiWave->gd, 0xeeeeee); imagefilledrectangle($result_MultiWave->gd, 0, 0, $result_width - 1, $captcha_height - 1, 0xeeeeee); // случайные параметры (можно поэкспериментировать с коэффициентами): // частоты $rand1 = mt_rand(700000, 1000000) / 15000000; $rand2 = mt_rand(700000, 1000000) / 15000000; $rand3 = mt_rand(700000, 1000000) / 15000000; $rand4 = mt_rand(700000, 1000000) / 15000000; // фазы $rand5 = mt_rand(0, 3141592) / 1000000; $rand6 = mt_rand(0, 3141592) / 1000000;