Jump to content

Imagecreate Question


9999

Recommended Posts

I can get this to work if I manually type in some text and assign it to the $text variable.  When I try to assign a file to the text variable all that is displyed is "array".

 

Also, what would be the correct way for me to save the image as "testimage.gif"?

 

<?php

$text = file('myfile.php');  // file used for output data

$im = imagecreate(325, 160);  // create a 325*160 image

$bg = imagecolorallocate($im, 0, 0, 0);  // black background color
$textcolor = imagecolorallocate($im, 255, 215, 0);  // gold text color

imagestring($im, 5, 0, 0, $text, $textcolor);  // write the string at the top left

// output the image
header("Content-type: image/gif");
imagegif($im);

// save the image
imagegif($img,"testimage.gif",80);

?>

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/43783-imagecreate-question/
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.