You may, (or may not) have noticed the image i use in the new members area now and again. I'm getting pretty quick at creating them but, let's face it, it's getting a tad tedious.
I'm wondering if someone could shed some light on this one
Firstly, the codes.
PHP tfgenerate.php http://193.111.226.179/tfgenerate.php
Code of tfgenerate.php
The fonts and raw PNG are in their reletive locations.
Now, we all know where I need things to go
Heres a sample:
Hoping CrazeD or someone can help me out
Cheers,
~ Tkey
I'm wondering if someone could shed some light on this one
Firstly, the codes.
PHP tfgenerate.php http://193.111.226.179/tfgenerate.php
Code of tfgenerate.php
Code:
<?php
header('Content-type: image/png');
$text = $_GET['text'];
$im = imagecreatefrompng ("tf.png");
$color = imagecolorallocate($im, 0, 0, 0);
$font = 'font.ttf';
$fontsize = 24;
$size = imagettfbbox($fontsize, 0, $font, $text); //calculate the pixel of the string
$dx = (imagesx($im)) - (abs($size[2]-$size[0])) - 20; //calculate the location to start the text
imagettftext($im, $fontsize, 0, $dx, 35, $color, $font, $text);
imagepng($im);
imagedestroy($im);
?>
The fonts and raw PNG are in their reletive locations.
Now, we all know where I need things to go
Heres a sample:
Hoping CrazeD or someone can help me out
Cheers,
~ Tkey