yep i'm creating abstract random images on the fly, but essential same problem. That header code seems to do the trick! thanks!
got one or two other things i am trying to do..
in the code that produces my image (see below) i am creating a random positioned and sized grey triangle with fill on a white background (got me?). trouble is from time to time my triangle has no fill and occasionally the image is grey with a white triangle and i have no idea why its doing this? if any one has an idea i would greatly appreciate it!!
$the_max = max ($number_one_x, $number_two_x, $number_three_x); //gets the maximum x coordinate
$the_min = min ($number_one_x, $number_two_x, $number_three_x); //gets the minimum x coordinate
$the_middle_x = (($the_max - $the_min) / 2); //gets the middle between the max and the min
$the_middle_x = $the_min + $the_middle_x; //adds the middle to the min to get middle of shape
$the_max = max ($number_one_y, $number_two_y, $number_three_y); //gets the maximum y coordinate
$the_min = min ($number_one_y, $number_two_y, $number_three_y); //gets the minimum y coordinate
$the_middle_y = (($the_max - $the_min) / 2); //gets the middle between the max and the min
$the_middle_y = $the_min + $the_middle_y; //adds the middle to the min to get middle of shape
//draws a polygon
$vertices = Array($number_one_x, $number_one_y, $number_two_x, $number_two_y, $number_three_x, $number_three_y); // set vertices
ImagePolygon($image, $vertices, 3, $grey1); // draw pentagon
ImageFillToBorder($image, $the_middle_x, $the_middle_y, $grey1, $grey1); // fill pentagon with green until it reaches grey border
Bookmarks