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? Quote 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 Quote 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. Quote 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!!!! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.