Ok its very easy to create a single rectangle, heres what I have now.
[code=php]<?
$im = @imagecreate(80, 80);
$background_color = imagecolorallocate($im, 177, 179, 188);
$cellSize=10;
$x_from=0;
$y_from=0;
$main_color = imagecolorallocate($im, 233, 14, 91);
$dark_color = imagecolorallocate($im, 200, 11, 73);
$light_color = imagecolorallocate($im, 255, 18, 110);
imagefilledrectangle ($im, $x_from, $y_from, $x_from + $cellSize – 1, $y_from + $cellSize – 1, $light_color );
imagefilledrectangle ($im, $x_from + 1, $y_from + 1, $x_from + $cellSize – 1, $y_from + $cellSize – 1, $dark_color );
imagefilledrectangle ($im, $x_from + $cellSize – 1, $y_from, $x_from + $cellSize – 1, $y_from, $dark_color );
imagefilledrectangle ($im, $x_from + 1, $y_from + 1, $x_from + $cellSize – 2, $y_from + $cellSize – 2, $main_color );
header(“Accept-Ranges: bytes”,true, 200);
ob_start(); // Turn on buffering
imagegif($im); // Output the image to the buffer
$imageSize=ob_get_length(); // Get size of image file
$imageData=ob_get_clean(); // Get image file contents
header(“Content-Length: $imageSize”);
header(“Content-Type: image/gif”);
header(“Last-Modified: Wed, 26 Jan 2005 18:36:31 GMT”);
echo $imageData; // Output the image data
imagedestroy($im);
?>
What I want to do is draw a diagram like this into a textarea
——*****——-
——**——-
——
and then it will somehow grab the coordinates and draw imagefilledrectangles where the stars are.