Evan's code for Drawing Complicated Circles
SLAVE CODE FOLLOWS
<?php
include('includes/header.php');
error_reporting(E_ALL);
// --- Create the image and save it to a file ---
$image = imagecreate(200, 200);
$yellow = imagecolorallocate($image, 0xFF, 0xFF, 0xAA);
$gray = imagecolorallocate($image, 0xC0, 0xC0, 0xC0);
$darkgray = imagecolorallocate($image, 0x90, 0x90, 0x90);
$navy = imagecolorallocate($image, 0x00, 0x00, 0x80);
$darknavy = imagecolorallocate($image, 0x00, 0x00, 0x50);
$red = imagecolorallocate($image, 0xFF, 0x00, 0x00);
$darkred = imagecolorallocate($image, 0x90, 0x00, 0x00);
// fill background
imagefilledrectangle($image, 0, 0, 400, 300, $yellow);
// create 3D pie chart effect
for ($i = 110; $i > 100; $i--) {
imagefilledarc($image, 100, $i, 100, 50, 0, 45, $darknavy, IMG_ARC_PIE);
imagefilledarc($image, 100, $i, 100, 50, 45, 75 , $darkgray, IMG_ARC_PIE);
imagefilledarc($image, 100, $i, 100, 50, 75, 360 , $darkred, IMG_ARC_PIE);
}
// draw top arcs
imagefilledarc($image, 100, 100, 100, 50, 0, 45, $navy, IMG_ARC_PIE);
imagefilledarc($image, 100, 100, 100, 50, 45, 75 , $gray, IMG_ARC_PIE);
imagefilledarc($image, 100, 100, 100, 50, 75, 360 , $red, IMG_ARC_PIE);
// save image to a temporary file
$filename = 'complicated_circles_temp.png';
imagepng($image, $filename);
imagedestroy($image);
?>
<h1>Evan's code for Drawing Complicated Circles</h1>
<!-- Display the generated image -->
<img src="<?php echo $filename; ?>" alt="complicated circles">
<hr><br>SLAVE CODE FOLLOWS<br><br>
<!-- Display this file's source code -->
<?php highlight_file(__FILE__); ?>
<?php include('includes/footer.php'); ?>