Jump to content

GD and dynamic coloring


andyd34

Recommended Posts

I am trying to create an image, well I have created the image and am now trying to color it but its not working. here is the image page.

 

$image = imagecreatetruecolor(20, 20);

$back = imagecolorallocate($image, 255,  255,  255);
$fore = imagecolorallocate($image, 77, 77, 77);

// Draw the polygon

imagefilledrectangle($image, 0, 0, 20, 20, $back);

imagefilledpolygon($image, array (20, 20, 20, 0, 0, 0), 3, $fore);

// Output the picture to the browser
header('Content-type: image/png');

imagepng($image);
imagedestroy($image);

 

and here is how I am calling the image

 

<img src="styles/images/start_end.php" />

 

 

is there a way i can dynamically change the image foreground & background colors???

Link to comment
https://forums.phpfreaks.com/topic/192452-gd-and-dynamic-coloring/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.