logo gen
Posted: Wed Jun 10, 2009 1:22 am
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
hi i guys ..
ok i have this code it writes on an img now what i need is to make a form were the users can write what they want on the img and when they click make it must show them the img with what they wrote here is my code, and make the writing much more bold the word from can stay there just needs to get bold and the other 1 that says bhawap.com must be the 1 were they get to write.
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:
Posting Code in the Forums to learn how to do it too.
hi i guys ..
ok i have this code it writes on an img now what i need is to make a form were the users can write what they want on the img and when they click make it must show them the img with what they wrote here is my code, and make the writing much more bold the word from can stay there just needs to get bold and the other 1 that says bhawap.com must be the 1 were they get to write.
Code: Select all
<?
// load the image from the file specified:
$im = imagecreatefrompng("test.png");
// if there's an error, stop processing the page:
if(!$im)
{
die("");
}
// define some colours to use with the image
$yellow = imagecolorallocate($im, 255, 255, 255);
// get the width and the height of the image
$width = imagesx($im);
$height = imagesy($im);
// now we want to write in the centre of the img:
$font = 4; // store the int ID of the system font we're using in $font
$text = "BhaWAP.com"; // store the text we're going to write in $text
$from = "From"; // store the text we're going to write in $from
// calculate the left position of the text:
$leftTextPos = ( $width - imagefontwidth($font)*strlen($text) )/2;
// finally, write the string:
imagestring($im, $font, $leftTextPos, $height-75, $from, $yellow);
imagestring($im, $font, $leftTextPos, $height-27, $text, $yellow);
// output the image
// tell the browser what we're sending it
Header('Content-type: image/png');
// output the image as a png
imagepng($im);
// tidy up
imagedestroy($im);
?>
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: