Forum Moderators: coopster

Message Too Old, No Replies

How do i create a image with php

Hoe do i create a image with php useing html

         

MrGecko

8:10 pm on Oct 19, 2006 (gmt 0)

10+ Year Member



How do I create a image with php using html for an example i want to make
<?
$message = "Welcome";
echo "<table width=\"435\" height=\"75\" border=\"2\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#ff3300\" bordercolor=\"#FF6600\" style=\"border-style:Dashed;\"><tr><td><center><h1><b> $message </b></h1></center></td></tr></table>";
?>
into an image
i have this code i like it but it only dose text
<?php
header ("Content-type: image/png");
function imageCreateTransparent($x, $y) {
$imageOut = imagecreate($x, $y);
$colourBlack = imagecolorallocate($imageOut, 0, 0, 0);
imagecolortransparent($imageOut, $colourBlack);
return $imageOut;
}
$im = imageCreateTransparent(70, 23)
or die("Cannot Initialize new GD image stream");
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 5, 3, 3, "Welcome", $text_color);
imagepng($im);
imagedestroy($im);
?>

dose any one know how to do my task?

[edited by: MrGecko at 8:45 pm (utc) on Oct. 19, 2006]

eelixduppy

9:04 pm on Oct 19, 2006 (gmt 0)



This isn't going to work how you want. There may be a class made out there somewhere that does something similar, but I'm thinking that you will have to use various image functions [us3.php.net] to accomplish what you want, or have an image premade and write the text over it.

Good luck! :)