andyd34 Posted February 18, 2010 Share Posted February 18, 2010 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 More sharing options...
teamatomic Posted February 18, 2010 Share Posted February 18, 2010 <img src="styles/images/start_end.php?fr=255&fg=255&fb=0&br=0&bg=0&bb=0" /> $fr=$_GET['fr']; .... $back = imagecolorallocate($image, $fr, $fg, $fb); $fore = imagecolorallocate($image, $br, $bg, $bb); HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/192452-gd-and-dynamic-coloring/#findComment-1014115 Share on other sites More sharing options...
andyd34 Posted February 18, 2010 Author Share Posted February 18, 2010 Thanks for your help Link to comment https://forums.phpfreaks.com/topic/192452-gd-and-dynamic-coloring/#findComment-1014124 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.