M
M4nimal
Guest
Soz.. I posted this here ... my bad.
http://forums.barrysworld.com/showthread.php?postid=615651#post615651
m4
http://forums.barrysworld.com/showthread.php?postid=615651#post615651
m4
<?php
[i]// Retrieve the text to be outputted[/i]
$MyText = "Hello world!";
[i]// Define the output type[/i]
header("Content-type: image/png");
[i]// Create a new image (x,y)[/i]
$MyImage = @imagecreate(30, 100);
[i]// Define the background colour (RGB value)[/i]
$MyBackgroundColour = imagecolorallocate($MyImage, 0, 51, 102);
[i]// Define the text colour (RGB value)[/i]
$MyTextColour = imagecolorallocate($MyImage, 255, 255, 255);
[i]// Render the text vertically[/i]
imagestringup($MyImage, 2, 7, 95, $MyText, $MyTextColour);
[i]// Output the result to the browser as a PNG image[/i]
imagepng($MyImage);
[i]// Free up any associated resources[/i]
imagedestroy($MyImage);
?>
[img]http://www.someurl.somesuffix/image.php[/img]
Originally posted by Mr. 47
wow, i've been meaning to test image creation for some time, just never botherd to learn how to do it...