Beispiel #1
0
    function drawPolygons()
    {
        for ($i = 1; $i <= $this->config["background_num"]; $i++) {
            $randomcolor = imagecolorallocate($this->oImage, mt_rand(190, 255), mt_rand(190, 255), mt_rand(190, 255));
            $coords = array();
            for ($j = 1; $j <= $this->config["polygon_point"]; $j++) {
                $coords[] = mt_rand(0, $this->width);
                $coords[] = mt_rand(0, $this->height);
            }
            imagefilledpolygon($this->oImage, $coords, $this->config["polygon_point"], $randomcolor);
        }
    }
    /**
     *  Create CAPTCHA iamge with BMP
     *  TODO
     */
    function createImageBmp($file = "")
    {
        $image = "";
        if (empty($file)) {
            header("Content-type: image/bmp");
            echo $image;
        } else {
            return $image;
        }
    }
}
$config = @(include "../config.php");
$image_handler = new XoopsCaptchaImageHandler();
$image_handler->setConfig($config);
$image_handler->loadImage();