使用php在背景图片中创建验证码涡旋效果

时间:2019-07-02 00:22:00

标签: php image gd captcha ellipse

我正在尝试使用php创建一个验证码系统。我希望图像的背景像此图像中的“漩涡”: vorteximage

我已经尝试过做到,但与我想要的接近。

这就是我得到的:

header('Content-Type: image/png');
        $width  = 250;
        $height = 100;

        $im = imagecreatetruecolor($width, $height);

        imagefill($im,0,0,imagecolorallocate($im, 255, 255, 255));

        $start = 5;
        $x = 0;
        $y = 0;
        for ($i = 0; $i < 20; $i++) {
            $x = rand(0,2 * $i);
            $y = rand(0,2 * $i);
            imageellipse($im, $x, $y, $start + (30 * $i), $start + (30 * $i), imagecolorallocate($im, 0, 0, 0));

        }

我需要帮助来创建上述图像背景(而不是文本)或任何其他选项来实现此目的。

0 个答案:

没有答案