superpimp Posted May 6, 2006 Share Posted May 6, 2006 I've got this peace of code that generates a blue image with a white line on it, well it should.When I try to run it it says this: Fatal error: Call to undefined function imagecreatetruecolor() in C:\wamp\www\test.php on line 5I checked the PHP manual and there is a function like this and Dreamweaver recognizes it. What should I do?[code]<?php// set up image $height = 200; $width = 200; $im = imagecreatetruecolor($width, $height); $white = imagecolorallocate($im, 255, 255, 255); $blue = imagecolorallocate($im, 0, 0, 64);// draw on image imagefill($im, 0, 0, $blue); imageline($im, 0, 0, $width, $height, $white); imagestring($im, 4, 50, 150, 'Sales', $white);// output image header ('Content-type: image/png'); imagepng ($im); // clean up imagedestroy($im);?>[/code]thx! Quote Link to comment Share on other sites More sharing options...
AndyB Posted May 6, 2006 Share Posted May 6, 2006 Do you have the GD library as part of your php installation? From the php manual section on imagecreatetruecolor:[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Depending on your PHP and GD versions this function is defined or not. With PHP 4.0.6 through 4.1.x this function always exists if the GD module is loaded, but calling it without GD2 being installed PHP will issue a fatal error and exit. With PHP 4.2.x this behaviour is different in issuing a warning instead of an error. Other versions only define this function, if the correct GD version is installed.[/quote] Quote Link to comment Share on other sites More sharing options...
superpimp Posted May 7, 2006 Author Share Posted May 7, 2006 I have PHP 5.0 so i guess I'll have to install it. Where can I get it? Quote Link to comment 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.