Out put dynamic images with text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Raghunath
Forum Newbie
Posts: 1
Joined: Thu Nov 18, 2010 5:37 am

Out put dynamic images with text

Post by Raghunath »

Hi All,

i am trying to Generate a image dynamically.
Up to here i am able to do it .
But when i give any echo statement with this its not working..
Here is my code pls help me in this

Code: Select all

<?php
// Create a 55x30 image
$im = imagecreatetruecolor(79, 79);
$unknow = imagecolorallocate($im, 0, 255, 255);
$white = imagecolorallocate($im, 255, 255, 255);

// Draw a white rectangle
imagefilledrectangle($im, 4, 4, 75, 25, $unknow);
imagefilledrectangle($im, 4, 29, 75, 50, $unknow);
imagefilledrectangle($im, 4, 54, 75, 75, $unknow);

// Save the image

echo 'hi hello';
header("Content-type: image/png");
//imagepng($im, './imagefilledrectangle.png');
imagepng($im);

imagedestroy($im);
?>
Thanks in advance.
Post Reply