Carla's Drawing
SLAVE CODE FOLLOWS
<?php
// === create background work area
// create a blank image that is 160 by 160 pixels in size
$image = imagecreatetruecolor(160, 160);
// set a color RGB (238, 238, 238), which is GRAY
$gray = imagecolorallocate($image, 238, 238, 238);
// fill the entire image
imagefilledrectangle($image, 0, 0, 160, 160, $gray);
$circleColor = imagecolorallocate($image, 200, 200, 255);
imagefilledellipse($image, 80, 80, 300, 150, $circleColor);
$circleColor2 = imagecolorallocate($image, 200, 50, 255);
imagefilledellipse($image, 80, 80, 150, 150, $circleColor2);
$polygonColor = imagecolorallocate($image, 40, 30, 150);
$points = [
60, 50,
150, 20,
80, 200
];
imagefilledpolygon($image, $points, 3, $polygonColor);
// create another color
$color1 = imagecolorallocate($image, 200, 160, 100);
// init vars
$x = 80;
$y = 100;
$corners[0] = array('x' => 100, 'y' => 100);
$corners[1] = array('x' => -130, 'y' => 200);
$corners[2] = array('x' => 40, 'y' =>300);
// create the graphic
for ($i = 0; $i < 100000; $i++)
{
imagesetpixel($image, round($x), round($y), $color1);
$a = rand(0, 2);
$x = ($x + $corners[$a]['x']) / 2;
$y = ($y + $corners[$a]['y']) / 2;
}
// set the foreground RGB color for the text
$color = imagecolorallocate($image, 255, 255, 255);
$font = '../Fonts/arial.ttf';
$str = "Capstelli";
// combine the background image with a rotated text using the following specs
// (image, font-size, angle-rotation, x-position, y-position, text-color, font-name, text)
imagettftext($image, 25, 20, 25, 130, $color, $font, $str);
// tell the server that a GIF image follows
header("Content-Type: image/gif");
// display the image
imagegif($image);
// destroy the image (i.e., releases memory)
imagedestroy($image);
?>