Veronica's code for Drawing Circles and Ovals
SLAVE CODE FOLLOWS
<?php
// create a PNG image file
// create a blank image that is 410 pixels wide and 300 pixels tall
$image = imagecreate(410, 300);
// create a color and fill (paint) the work area
// set the color RGB (244, 244, 244), which is LIGHTGRAY
$gray = imagecolorallocate($image, 244, 244, 244);
// fill the entire image (410 px x 300 px)
imagefilledrectangle($image, 0, 0, 410, 300, $gray);
// === create an object (a circle)
// set size variable for circle
$size = 200;
$loops = 200;
// set color variables for rgb
$r = 0;
$g = 0;
$b = 255;
for ($i = 0; $i < $loops; $i+=5)
{
// start the current foreground color to RGB (0, 0, 255), which is BLUE
$color = imagecolorallocate ($image, $r, $g, $b);
// DRAW a circle (image, x, y, arc-width, arc-height, start-angle, end-angle, color)
imagearc($image, 200, 150, $size, $size, 0, 360, $color);
// change size, color
$size = $size - 10.5;
$r = $r + 1;
$g = $g + 1;
}
// === create another object (an oval)
// set the current foreground color to RGB (210, 15, 80), which is DARKRED
$red = imagecolorallocate ($image, 210, 15, 80);
// DRAW an oval (image, x, y, arc-width, arc-height, start-angle, end-angle, color)
imagearc($image, 200, 150, 380, 220, 0, 360, $red);
//=== display the image
// tell the server that a PNG image follows
header("Content-type: image/png");
// display the image
imagepng($image);
// destroy the image (i.e., release memory)
imagedestroy ($image);
?>