Jump to content

Out put dynamic images with text


raghunath

Recommended Posts

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

<?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.

Link to comment
https://forums.phpfreaks.com/topic/219071-out-put-dynamic-images-with-text/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.