zhahaman2001 Posted March 21, 2007 Share Posted March 21, 2007 <?php $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, "/WINDOWS/Fonts/IMPACT.ttf", "IMPACT FONT HIP HIP Hurray!!!"); ImagePNG($im); ?> I got that code to work but how would I save that image to a dir like /images ? Link to comment https://forums.phpfreaks.com/topic/43587-solved-save-image/ Share on other sites More sharing options...
fert Posted March 21, 2007 Share Posted March 21, 2007 ImagePNG($im,"file.png"); Link to comment https://forums.phpfreaks.com/topic/43587-solved-save-image/#findComment-211687 Share on other sites More sharing options...
per1os Posted March 21, 2007 Share Posted March 21, 2007 bool imagepng ( resource $image [, string $filename [, int $quality [, int $filters]]] ) So I think the usage would be like this <?php $im = imagecreate (250, 28); $black = ImageColorAllocate ($im, 0, 0, 0); $yellow = ImageColorAllocate ($im, 235, 235, 51); ImageTTFText ($im, 20, 0, 10, 20, $yellow, "/WINDOWS/Fonts/IMPACT.ttf", "IMPACT FONT HIP HIP Hurray!!!"); ImagePNG($im, '/dir/to/save/image.png'); ?> It should save it under /dir/to/save/image.png Link to comment https://forums.phpfreaks.com/topic/43587-solved-save-image/#findComment-211688 Share on other sites More sharing options...
zhahaman2001 Posted March 21, 2007 Author Share Posted March 21, 2007 thanks guys Link to comment https://forums.phpfreaks.com/topic/43587-solved-save-image/#findComment-211695 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.