Fun Shapes!

Here are a few fun shapes designed with PHP.

triangle

square

line



SLAVE CODE FOLLOWS

<?php

$image 
imagecreate(150200);

$na imagecolorallocate($image2550255);

$color imagecolorallocate($image255255204);

$triangle = array(10,20100,200300,200);

$pts count($triangle)/2;

imagepolygon($image$triangle$pts$color);

imagefilledpolygon($image$triangle$pts$color);

header("Content-type: image/png");

imagepng($image);

imagedestroy ($image);

?>


SLAVE CODE FOLLOWS

<?php
$myRectangle 
imagecreate200100);
$myOne imagecolorallocate$myRectangle25500);
$myTwo imagecolorallocate$myRectangle153204255);
imagerectangle$myRectangle153512060$myOne);
header("Content-type: image/png");
imagepng($myRectangle);
imagedestroy($myRectangle);
?>


SLAVE CODE FOLLOWS

<?php
$myLine 
imagecreate200100);
$myBlue imagecolorallocate$myLine255255255);
$myGreen imagecolorallocate$myLine128128128);
imageline$myLine4004006060$myGreen);
header("Content-type: image/png");
imagepng($myLine);
imagedestroy($myLine);
?>