0) for ($i = 0; $i < $num_polygons; $i++) { $vertices = array ( mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25), mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25), mt_rand(-0.25*$width,$width*1.25),mt_rand(-0.25*$width,$width*1.25) ); $color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha); imagefilledpolygon($image, $vertices, 3, $color); } // Draw random circles if ($num_ellipses > 0) for ($i = 0; $i < $num_ellipses; $i++) { $x1 = mt_rand(0,$width); $y1 = mt_rand(0,$height); $color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha); // $color = imagecolorallocate($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast)); imagefilledellipse($image, $x1, $y1, mt_rand($min_radius,$max_radius), mt_rand($min_radius,$max_radius), $color); } // Draw random lines if ($num_lines > 0) for ($i = 0; $i < $num_lines; $i++) { $x1 = mt_rand(-$width*0.25,$width*1.25); $y1 = mt_rand(-$height*0.25,$height*1.25); $x2 = mt_rand(-$width*0.25,$width*1.25); $y2 = mt_rand(-$height*0.25,$height*1.25); $color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), $object_alpha); imagesetthickness ($image, mt_rand($min_thickness,$max_thickness)); imageline($image, $x1, $y1, $x2, $y2 , $color); } // Draw random dots if ($num_dots > 0) for ($i = 0; $i < $num_dots; $i++) { $x1 = mt_rand(0,$width); $y1 = mt_rand(0,$height); $color = imagecolorallocatealpha ($image, mt_rand(0,$o_contrast), mt_rand(0,$o_contrast), mt_rand(0,$o_contrast),$object_alpha); imagesetpixel($image, $x1, $y1, $color); } session_start(); $_SESSION['string'] = $password; header('Content-type: image/png'); imagepng($image); imagedestroy($image); ?>