galvin Posted December 4, 2008 Share Posted December 4, 2008 I'm using ... $new_image = imagecreate(400, 200); ...but it creates a BLACK image background. How can I make it WHITE instead? Link to comment https://forums.phpfreaks.com/topic/135445-solved-creating-a-white-background-with-imagecreate/ Share on other sites More sharing options...
corbin Posted December 4, 2008 Share Posted December 4, 2008 http://php.net/manual/en/function.imagefill.php Link to comment https://forums.phpfreaks.com/topic/135445-solved-creating-a-white-background-with-imagecreate/#findComment-705634 Share on other sites More sharing options...
.josh Posted December 4, 2008 Share Posted December 4, 2008 imagecreate() creates an image identifier, like a resource stream. It's a "black" background because that's the standard "nothing is added to the image yet" background. There's no way to change that initial color. What you would instead do is use something like imagefill to floodfill the image. Or maybe use imagefilledrectangle. Link to comment https://forums.phpfreaks.com/topic/135445-solved-creating-a-white-background-with-imagecreate/#findComment-705636 Share on other sites More sharing options...
galvin Posted December 4, 2008 Author Share Posted December 4, 2008 You guys are the best, imagefill() worked perfectly, thanks so much!!!! Link to comment https://forums.phpfreaks.com/topic/135445-solved-creating-a-white-background-with-imagecreate/#findComment-705639 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.