The following is some code that was supplied to me by a Tek-Tips member (pjadie - thanks again) which works great except when I try to save it to file. I have tried to add to the imagepng($im);
with this
imagepng($im, 'new_image.png', 100);
i have also tried by declaring a $new_image variable but it won't work.
Any ideas???
Cheers
with this
imagepng($im, 'new_image.png', 100);
i have also tried by declaring a $new_image variable but it won't work.
Any ideas???
Cheers
Code:
<?php
//get tektips logo
$im = imagecreatefromgif('[URL unfurl="true"]http://www.tek-tips.com/images/logo.gif');[/URL]
//get the image size
$w = imagesx($im);
$h = imagesy($im);
//now create the text on a new canvas (i've used identical sized canvases but in practice you probably will not want to do so)
$text = imagecreatetruecolor($w, $h);
//place some text at the top left
imagestring($text, 5, 0, 0, 'Tek-Tips', 0x0000FF);
// merge the two canvas
//set opacity to 50%
imagecopymerge($im, $text, 0, 0, 0, 0, $w, $h, 50);
// output the image
header('Content-Type: image/png');
imagepng($im);
imagedestroy ($text);
imagedestroy($im);
?>