Zeile 95 | Zeile 95 |
---|
imagefill($im, 0, 0, $bg_color);
// Draw random circles, squares or lines?
|
imagefill($im, 0, 0, $bg_color);
// Draw random circles, squares or lines?
|
$to_draw = my_rand(0, 2);
| $to_draw = rand(0, 2);
|
if($to_draw == 1) { draw_circles($im);
| if($to_draw == 1) { draw_circles($im);
|
Zeile 135 | Zeile 135 |
---|
for($i = 10; $i < $img_width; $i += 10) {
|
for($i = 10; $i < $img_width; $i += 10) {
|
$color = imagecolorallocate($im, my_rand(150, 255), my_rand(150, 255), my_rand(150, 255));
| $color = imagecolorallocate($im, rand(150, 255), rand(150, 255), rand(150, 255));
|
imageline($im, $i, 0, $i, $img_height, $color); } for($i = 10; $i < $img_height; $i += 10) {
|
imageline($im, $i, 0, $i, $img_height, $color); } for($i = 10; $i < $img_height; $i += 10) {
|
$color = imagecolorallocate($im, my_rand(150, 255), my_rand(150, 255), my_rand(150, 255));
| $color = imagecolorallocate($im, rand(150, 255), rand(150, 255), rand(150, 255));
|
imageline($im, 0, $i, $img_width, $i, $color); } }
| imageline($im, 0, $i, $img_width, $i, $color); } }
|
Zeile 157 | Zeile 157 |
---|
$circles = $img_width*$img_height / 100; for($i = 0; $i <= $circles; ++$i) {
|
$circles = $img_width*$img_height / 100; for($i = 0; $i <= $circles; ++$i) {
|
$color = imagecolorallocate($im, my_rand(180, 255), my_rand(180, 255), my_rand(180, 255)); $pos_x = my_rand(1, $img_width); $pos_y = my_rand(1, $img_height); $circ_width = ceil(my_rand(1, $img_width)/2); $circ_height = my_rand(1, $img_height); imagearc($im, $pos_x, $pos_y, $circ_width, $circ_height, 0, my_rand(200, 360), $color);
| $color = imagecolorallocate($im, rand(180, 255), rand(180, 255), rand(180, 255)); $pos_x = rand(1, $img_width); $pos_y = rand(1, $img_height); $circ_width = ceil(rand(1, $img_width)/2); $circ_height = rand(1, $img_height); imagearc($im, $pos_x, $pos_y, $circ_width, $circ_height, 0, rand(200, 360), $color);
|
} }
| } }
|
Zeile 178 | Zeile 178 |
---|
$dot_count = $img_width*$img_height/5; for($i = 0; $i <= $dot_count; ++$i) {
|
$dot_count = $img_width*$img_height/5; for($i = 0; $i <= $dot_count; ++$i) {
|
$color = imagecolorallocate($im, my_rand(200, 255), my_rand(200, 255), my_rand(200, 255)); imagesetpixel($im, my_rand(0, $img_width), my_rand(0, $img_height), $color);
| $color = imagecolorallocate($im, rand(200, 255), rand(200, 255), rand(200, 255)); imagesetpixel($im, rand(0, $img_width), rand(0, $img_height), $color);
|
} }
| } }
|
Zeile 195 | Zeile 195 |
---|
$square_count = 30; for($i = 0; $i <= $square_count; ++$i) {
|
$square_count = 30; for($i = 0; $i <= $square_count; ++$i) {
|
$color = imagecolorallocate($im, my_rand(150, 255), my_rand(150, 255), my_rand(150, 255)); $pos_x = my_rand(1, $img_width); $pos_y = my_rand(1, $img_height); $sq_width = $sq_height = my_rand(10, 20);
| $color = imagecolorallocate($im, rand(150, 255), rand(150, 255), rand(150, 255)); $pos_x = rand(1, $img_width); $pos_y = rand(1, $img_height); $sq_width = $sq_height = rand(10, 20);
|
$pos_x2 = $pos_x + $sq_height; $pos_y2 = $pos_y + $sq_width; imagefilledrectangle($im, $pos_x, $pos_y, $pos_x2, $pos_y2, $color);
| $pos_x2 = $pos_x + $sq_height; $pos_y2 = $pos_y + $sq_width; imagefilledrectangle($im, $pos_x, $pos_y, $pos_x2, $pos_y2, $color);
|
Zeile 230 | Zeile 230 |
---|
if($use_ttf) { // Select a random font size
|
if($use_ttf) { // Select a random font size
|
$font_size = my_rand($min_size, $max_size);
| $font_size = rand($min_size, $max_size);
|
// Select a random font $font = array_rand($ttf_fonts); $font = $ttf_fonts[$font];
// Select a random rotation
|
// Select a random font $font = array_rand($ttf_fonts); $font = $ttf_fonts[$font];
// Select a random rotation
|
$rotation = my_rand($min_angle, $max_angle);
| $rotation = rand($min_angle, $max_angle);
|
// Set the colour
|
// Set the colour
|
$r = my_rand(0, 200); $g = my_rand(0, 200); $b = my_rand(0, 200);
| $r = rand(0, 200); $g = rand(0, 200); $b = rand(0, 200);
|
$color = imagecolorallocate($im, $r, $g, $b);
// Fetch the dimensions of the character being added
| $color = imagecolorallocate($im, $r, $g, $b);
// Fetch the dimensions of the character being added
|
Zeile 256 | Zeile 256 |
---|
$pos_y = ceil(($img_height-$string_height/2));
// Draw a shadow
|
$pos_y = ceil(($img_height-$string_height/2));
// Draw a shadow
|
$shadow_x = my_rand(-3, 3) + $pos_x; $shadow_y = my_rand(-3, 3) + $pos_y;
| $shadow_x = rand(-3, 3) + $pos_x; $shadow_y = rand(-3, 3) + $pos_y;
|
$shadow_color = imagecolorallocate($im, $r+20, $g+20, $b+20); imagefttext($im, $font_size, $rotation, $shadow_x, $shadow_y, $shadow_color, $font, $string[$i], array());
| $shadow_color = imagecolorallocate($im, $r+20, $g+20, $b+20); imagefttext($im, $font_size, $rotation, $shadow_x, $shadow_y, $shadow_color, $font, $string[$i], array());
|
Zeile 272 | Zeile 272 |
---|
// Calculate character offsets $pos_x = $spacing / 4 + $i * $spacing;
|
// Calculate character offsets $pos_x = $spacing / 4 + $i * $spacing;
|
$pos_y = $img_height / 2 - $string_height -10 + my_rand(-3, 3);
| $pos_y = $img_height / 2 - $string_height -10 + rand(-3, 3);
|
// Create a temporary image for this character if(gd_version() >= 2)
| // Create a temporary image for this character if(gd_version() >= 2)
|
Zeile 288 | Zeile 288 |
---|
imagecolortransparent($temp_im, $bg_color);
// Set the colour
|
imagecolortransparent($temp_im, $bg_color);
// Set the colour
|
$r = my_rand(0, 200); $g = my_rand(0, 200); $b = my_rand(0, 200);
| $r = rand(0, 200); $g = rand(0, 200); $b = rand(0, 200);
|
$color = imagecolorallocate($temp_im, $r, $g, $b);
// Draw a shadow
|
$color = imagecolorallocate($temp_im, $r, $g, $b);
// Draw a shadow
|
$shadow_x = my_rand(-1, 1); $shadow_y = my_rand(-1, 1);
| $shadow_x = rand(-1, 1); $shadow_y = rand(-1, 1);
|
$shadow_color = imagecolorallocate($temp_im, $r+50, $g+50, $b+50); imagestring($temp_im, 5, 1+$shadow_x, 1+$shadow_y, $string[$i], $shadow_color);
| $shadow_color = imagecolorallocate($temp_im, $r+50, $g+50, $b+50); imagestring($temp_im, 5, 1+$shadow_x, 1+$shadow_y, $string[$i], $shadow_color);
|