Page 1 of 1

Out put dynamic images with text

Posted: Thu Nov 18, 2010 6:21 am
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.