PDA

View Full Version : Source to create generators!!!


digi duck
06-03-2006, 10:36 AM
I have found some source that creates an image generator like

link (http://churchsigngenerator.com/index_1.php)

and i got the source code for it from here:

link (http://churchsigngenerator.com/source.phps)

problem is i don't know what to do with it. Could somebody explain to me which parts of the source i need to change and help me create one similar to that shown for my own site. Please help me (i've looked through tuts on php etc but still can't get the hang of it.)

Thanks a lot.

Mwnciau
06-03-2006, 04:55 PM
you need to create a form -


<form name="form" method="get" action="generator.php">
<input type="text" value="line1" name="line1" />
<input type="text" value="line2" name="line2" />
<input type="text" value="line3" name="line3" />
<input type="text" value="line4" name="line4" />
<input type="submit" value="Submit!" />
</form>

digi duck
06-03-2006, 05:30 PM
ok ive done that but when i click submit it comes up with some errors and i dont know why?

the program is herehttp://houseofhalo.co.uk/sig put some text in the box and it should show you the annoying errors.

thanks a lot

vinyl-junkie
06-03-2006, 05:48 PM
Post your code. It's impossible to help you without that.

digi duck
06-03-2006, 06:13 PM
ok sorry

I actually just managed to get around the errors by putting in the head.png and chars.png like this $chars_img = imagecreatefrompng("chars.png");
$basesign_img = imagecreatefrompng("head.png");

the problem is that i think i need to put all of the character info i.e
$widths[ 32] = 4; // space
$widths[ 33] = 5; // !
$widths[ 34] = 7; // "
$widths[ 35] = 9; // #
$widths[ 36] = 8; // $
$widths[ 37] = 12; // %
etc. etc. etc.

and i dont know how to put this in a .png file.

anyway this is all the code just incase you need it:

<?php

/*
get the text for each line from the query string, strip out backslashes
*/

$line[1] = stripslashes($_GET['line1']);
/*
Character widths are put in an array, $widths. Note that the array is indexed by
the character's ASCII ordinal value. That makes it easy to retrieve the value
by using the ord() function in PHP to get ASCII values from each character in
the user's input. (The full ISO8859-1 character set is available, except where noted.)
*/

$widths[ 32] = 4; // space
$widths[ 33] = 5; // !
$widths[ 34] = 7; // "
$widths[ 35] = 9; // #
$widths[ 36] = 8; // $
$widths[ 37] = 12; // %
$widths[ 38] = 10; // &
$widths[ 39] = 4; // '
$widths[ 40] = 5; // (
$widths[ 41] = 5; // )
$widths[ 42] = 6; // *
$widths[ 43] = 8; // +
$widths[ 44] = 4; // ,
$widths[ 45] = 5; // -
$widths[ 46] = 4; // .
$widths[ 47] = 5; // /
$widths[ 48] = 8; // 0
$widths[ 49] = 7; // 1
$widths[ 50] = 8; // 2
$widths[ 51] = 8; // 3
$widths[ 52] = 8; // 4
$widths[ 53] = 8; // 5
$widths[ 54] = 8; // 6
$widths[ 55] = 8; // 7
$widths[ 56] = 8; // 8
$widths[ 57] = 8; // 9
$widths[ 58] = 5; // :
$widths[ 59] = 5; // ;
$widths[ 60] = 9; // <
$widths[ 61] = 9; // =
$widths[ 62] = 9; // >
$widths[ 63] = 9; // ?
$widths[ 64] = 14; // @
$widths[ 65] = 10; // A
$widths[ 66] = 10; // B
$widths[ 67] = 10; // C
$widths[ 68] = 10; // D
$widths[ 69] = 9; // E
$widths[ 70] = 9; // F
$widths[ 71] = 11; // G
$widths[ 72] = 10; // H
$widths[ 73] = 5; // I
$widths[ 74] = 8; // J
$widths[ 75] = 11; // K
$widths[ 76] = 9; // L
$widths[ 77] = 11; // M
$widths[ 78] = 10; // N
$widths[ 79] = 11; // O
$widths[ 80] = 9; // P
$widths[ 81] = 11; // Q
$widths[ 82] = 10; // R
$widths[ 83] = 9; // S
$widths[ 84] = 9; // T
$widths[ 85] = 10; // U
$widths[ 86] = 10; // V
$widths[ 87] = 13; // W
$widths[ 88] = 10; // X
$widths[ 89] = 10; // Y
$widths[ 90] = 9; // Z
$widths[ 91] = 6; // [
$widths[ 92] = 5; // \
$widths[ 93] = 5; // ]
$widths[ 94] = 8; // ^
$widths[ 95] = 8; // _
$widths[ 96] = 5; // `
$widths[ 97] = 10; // a
$widths[ 98] = 10; // b
$widths[ 99] = 10; // c
$widths[100] = 10; // d
$widths[101] = 9; // e
$widths[102] = 9; // f
$widths[103] = 11; // g
$widths[104] = 10; // h
$widths[105] = 5; // i
$widths[106] = 8; // j
$widths[107] = 11; // k
$widths[108] = 9; // l
$widths[109] = 11; // m
$widths[110] = 10; // n
$widths[111] = 11; // o
$widths[112] = 9; // p
$widths[113] = 11; // q
$widths[114] = 10; // r
$widths[115] = 9; // s
$widths[116] = 9; // t
$widths[117] = 10; // u
$widths[118] = 10; // v
$widths[119] = 13; // w
$widths[120] = 10; // x
$widths[121] = 10; // y
$widths[122] = 9; // z
$widths[123] = 6; // {
$widths[124] = 4; // |
$widths[125] = 6; // }
$widths[126] = 9; // ~
$widths[127] = 0; // nothing
$widths[128] = 8; // €
$widths[129] = 0; // nothing
$widths[130] = 4; // ‚
$widths[131] = 9; // ƒ
$widths[132] = 7; // „
$widths[133] = 13; // …
$widths[134] = 8; // †
$widths[135] = 8; // ‡
$widths[136] = 6; // ˆ
$widths[137] = 14; // ‰
$widths[138] = 10; // Š
$widths[139] = 5; // ‹
$widths[140] = 14; // Œ
$widths[141] = 0; // nothing
$widths[142] = 9; // Ž
$widths[143] = 0; // nothing
$widths[144] = 0; // nothing
$widths[145] = 5; // ‘
$widths[146] = 5; // ’
$widths[147] = 7; // “
$widths[148] = 7; // ”
$widths[149] = 6; // •
$widths[150] = 9; // –
$widths[151] = 14; // —
$widths[152] = 6; // ˜
$widths[153] = 13; // ™
$widths[154] = 10; // š
$widths[155] = 6; // ›
$widths[156] = 14; // œ
$widths[157] = 0; // nothing
$widths[158] = 9; // Ž
$widths[159] = 10; // Ÿ
$widths[160] = 4; // space
$widths[161] = 5; // ¡
$widths[162] = 8; // ¢
$widths[163] = 9; // £
$widths[164] = 9; // ¤
$widths[165] = 9; // ¥
$widths[166] = 4; // ¦
$widths[167] = 8; // §
$widths[168] = 6; // ¨
$widths[169] = 11; // ©
$widths[170] = 6; // ª
$widths[171] = 8; // «
$widths[172] = 9; // ¬
$widths[173] = 6; // *
$widths[174] = 11; // ®
$widths[175] = 10; // ¯
$widths[176] = 7; // °
$widths[177] = 10; // ±
$widths[178] = 6; // ²
$widths[179] = 6; // ³
$widths[180] = 5; // ´
$widths[181] = 10; // µ
$widths[182] = 9; // ¶
$widths[183] = 7; // ·
$widths[184] = 5; // ¸
$widths[185] = 5; // ¹
$widths[186] = 6; // º
$widths[187] = 8; // »
$widths[188] = 12; // ¼
$widths[189] = 12; // ½
$widths[190] = 12; // ¾
$widths[191] = 9; // ¿
$widths[192] = 11; // À
$widths[193] = 11; // Á
$widths[194] = 11; // Â
$widths[195] = 11; // Ã
$widths[196] = 11; // Ä
$widths[197] = 11; // Å
$widths[198] = 14; // Æ
$widths[199] = 10; // Ç
$widths[200] = 9; // È
$widths[201] = 9; // É
$widths[202] = 9; // Ê
$widths[203] = 9; // Ë
$widths[204] = 5; // Ì
$widths[205] = 5; // Í
$widths[206] = 5; // Î
$widths[207] = 5; // Ï
$widths[208] = 10; // Ð
$widths[209] = 10; // Ñ
$widths[210] = 11; // Ò
$widths[211] = 11; // Ó
$widths[212] = 11; // Ô
$widths[213] = 11; // Õ
$widths[214] = 11; // Ö
$widths[215] = 8; // ×
$widths[216] = 11; // Ø
$widths[217] = 10; // Ù
$widths[218] = 10; // Ú
$widths[219] = 10; // Û
$widths[220] = 10; // Ü
$widths[221] = 10; // Ý
$widths[222] = 10; // Þ
$widths[223] = 9; // ß
$widths[224] = 11; // à
$widths[225] = 11; // á
$widths[226] = 11; // â
$widths[227] = 11; // ã
$widths[228] = 11; // ä
$widths[229] = 11; // å
$widths[230] = 14; // æ
$widths[231] = 10; // ç
$widths[232] = 9; // è
$widths[233] = 9; // é
$widths[234] = 9; // ê
$widths[235] = 9; // ë
$widths[236] = 5; // ì
$widths[237] = 5; // í
$widths[238] = 5; // î
$widths[239] = 5; // ï
$widths[240] = 10; // Ð
$widths[241] = 10; // ñ
$widths[242] = 11; // ò
$widths[243] = 11; // ó
$widths[244] = 11; // ô
$widths[245] = 11; // õ
$widths[246] = 11; // ö
$widths[247] = 10; // ÷
$widths[248] = 11; // ø
$widths[249] = 10; // ù
$widths[250] = 10; // ú
$widths[251] = 10; // û
$widths[252] = 10; // ü
$widths[253] = 10; // ý
$widths[254] = 10; // þ
$widths[255] = 10; // ÿ

/* load the characters image and the background sign image into memory */

$chars_img = imagecreatefrompng("chars.png");
$basesign_img = imagecreatefrompng("head.png");

/* get the width and height of the background image */

$src_w = imagesx($basesign_img);
$src_h = imagesy($basesign_img);

/* create a new image, that will be output to the browser */

$output_img = imagecreatetruecolor($src_w, $src_h);

/* copy the background image onto the output image */

imagecopy($output_img, $basesign_img, 0,0,0,0, $src_w, $src_h);

/* Since the letters are centered on the sign, the x centerpoint gives a starting point from
which the x offset for each letter can be calculated. The y offset is simply the distance
from the top of the image to the top of the first row of letters. */

$x_center = 170;
$y_offset = 141;

/* Set maximum line width to keep characters from drifting off the edges
of the sign */

$max_line_width = 21;

/* loop through each row */
for ($l = 1; $l < 5; $l++) {
$x_offset = 0;
$truncate_to = 0;

/* This first pass is to calculate the x offset for each row, since the width of the
line of characters is different for each row. It loops through the letters adds the
width of each letter to the x offset to get the beginning point for each line. */
for ($i = 0; $i < strlen($line[$l]); $i++) {
$curchar = substr($line[$l], $i, 1);

// if the x offset plus the width of the current character
// don't exceed the max line width, add the width to the offset
if ($x_offset + $widths[ord($curchar)] <= $max_line_width) {
$x_offset += $widths[ord($curchar)];
$truncate_to++;
}
}

/* lop off characters that would have exceeded max_line_width */
$line[$l] = substr($line[$l],0,$truncate_to);

/* since we're centering, we divide the offset by 2 */
$x_offset = ceil($x_offset / 2);

/* Now we loop through each character and copy it onto the background image. */

for ($i = 0; $i < strlen($line[$l]); $i++) {
$curchar = substr($line[$l], $i, 1);
// copy the region from the source image containing the letter we want
// to the destination image
imagecopy(
$output_img, // destination image: the image we're building
$chars_img, // source image: chars1.png
$x_center - $x_offset, // destination X coord: the center minus the x offset
$y_offset, // destination Y coord: equal to y offset
0, // source image X coord: always zero
(ord($curchar) - 32) * 18, // source image Y coord: character ASCII value - 32 times line height
16, // source area width
18 // source area height
);
$x_offset -= $widths[ord($curchar)];
}

/* When each row is complete, add 16 pixels to the Y offset to get the top of the new row. */
$y_offset += 16;
}

/* Now that the image is built, it gets sent to the browser. First, send out HTTP headers to
tell the browser a JPEG image is coming and that it should be called "churchsign.jpg". */
header("Content-Type: image/jpeg");
header("Content-Disposition: inline; filename=yoursig.jpg");

/* The imagejpeg() function sends the output img to the browser. */
imagejpeg($output_img);

/* Housekeeping functions - destroy the scratch images to free up the memory they take up. */
imagedestroy($basesign_img);
imagedestroy($chars_img);
imagedestroy($output_img);

?>

thanks for all the help

Ryland
06-04-2006, 01:44 AM
Part of the problem is that your form uses the POST method, but the generator script looks for a GET variable. Change the method parameter in you form from POST to GET.

Also: those width values aren't embedded in the PNG file. You get those values by measuring the width of the letters in your PNG file in pixels and placing that value in the corresponding element in the $widths array. For example, the letter A in the PNG used on churchsigngenerator.com is 10 pixels wide, and letter A is ASCII value 65 (the element index number corresponds to the letter's ASCII value, to keep things simple), so therefore $widths[ 65] = 10.

digi duck
06-04-2006, 09:07 AM
wow thanks.

the changing to GET worked fine but i'm still a bit confused about the chars thing.

This is what i've done:
1-created a photoshop file and got the type tool and drew all the letters in.
2-saved this as chars.png and uploaded to the same folder as the script.
3-replaced the values in the code to the correct width sizes.
4-tested and it comes up with a black square and no writing.

sorry this is taking so much explaining but it doesn't seem to work for me.:confused:

Ryland
06-04-2006, 10:05 AM
Link to your PNG file, please. It may be a problem with transparency.

digi duck
06-04-2006, 12:28 PM
my host does not allow direct linking to image's so i uploaded it to here
Click here (http://img146.imageshack.us/img146/8835/chars3zq.png)

I'm sure i've made a stupid mistake and i'm going to laugh at myself.
thanks

Ryland
06-04-2006, 02:46 PM
OK, several problems with your PNG file:

1. The background needs to be transparent (unless you want the letter background to be white on your output image, anyway).

2. The letters all need to be in one vertical block instead of several rows.

3. They need to start at 0,0 - that is, at the very top left corner of the image.

4. You need to use the entire ISO8859-1 character set, not just the letters and numbers, otherwise the script won't pick up the correct characters, because they're out of ASCII order. (If you want to restrict it to certain characters, you'll have to alter the PHP script.)

I attached an example PNG file to show you what I'm talking about. It's one of the character sets from churchsigngenerator.com so you'll still need to make your own, but it'll give you an idea of what you need to do.

digi duck
06-04-2006, 02:59 PM
Thankyou, You Are A Legend!!!!! It Works :)

digi duck
06-13-2006, 09:58 AM
Hi i'm afraid i spoke too soon :( . The generator worked fine with the example chars.png but when i created a new chars file with the font and size that i wanted it said it was not a valid png file, eventhough thats what i had saved it as. This is the chars file i created
[img=http://img147.imageshack.us/img147/5863/chars8bp.png] (http://imageshack.us)

can anyone see where i'm going wrong i'm not too good with photoshop.
Cheers

digi duck
06-17-2006, 09:36 AM
*bump*

SpecialFX
06-18-2006, 07:37 AM
I found this script and it as well works with the chars.png made for church signs, however doesn't work when I place my chars.png in there, take a look at the chars.png www.fallenskydesigns.com/pic/chars2.png

Thanks in Advance,
SpecialFX

digi duck
06-18-2006, 08:11 PM
thanks but ive managed to do it. ill post the script that i used later. Anyway thanks everyone and here's the final thing

http://gamesigs.co.uk

Java Pete
07-31-2006, 08:16 PM
Could you please email the script. I have a copy from the church sign page and I am getting errors. I says it cannot find the image, although it exists in the same directory. I would really appreciate your help.

Sincerely,

Pete Iverson

van21691
10-29-2006, 06:06 PM
how would you change the height of the letters?

van21691
10-29-2006, 06:28 PM
thanks but ive managed to do it. ill post the script that i used later. Anyway thanks everyone and here's the final thing

http://gamesigs.co.uk

wow congrats
can you message me with the script please
thank you

van21691
10-29-2006, 08:12 PM
how big should the text for the chars.png?

digi duck
10-30-2006, 09:52 AM
Ok i ended up not using the church sign generator script due to all the problems i was encountering using the chars.png file. After doing a bit of googling i came across this script.

http://hotscripts.com/Detailed/47020.html

Its called Net avatar maker and it does the same thing that the church sign generator does just it a much easier way.

I made a few changes to this script to make it better, so you can you this one instead if you want.

<?php
header("Content-type: image/jpeg");

$name = stripslashes($_GET['name']);

$size = stripslashes($_GET['size']);

$centre = stripslashes($_GET['centre']);

$font = 'images/sig_maker/fonts/'.stripslashes($_GET['font']).'.ttf';

$fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED

$fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN

$fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE

$lines = stripslashes($_GET['lines']);

function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
///

}

if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '47')
{
$bgpic = 'images/sig_maker/' . $_GET['color'] . '.jpeg';
}


$im = imagecreatefromjpeg($bgpic);

//Calculate, the centre:

for(;;){

list($image_width, $image_height) = getimagesize($bgpic);
list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
$text_width = $right_x - $left_x;
if($image_width > $text_width+5){

break;

}

$size = $size - .5;
if($size == 1){
die('Script not responding to decreasing font size, in other words: try using less letters.');
}

}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height/2);

$textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
if($centre== 'y'){

imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);

}else{

imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);

}

imagegif($im);
imagedestroy($im);
?>

This is the page that actually creates the image with text on. The changes i have made to the script are letting the user deicde whether thay want the text placeed in the middle of the pic or in a given coordinate, also whether they want it at an angle. You will also need the form on a seperate page to send the information i.e what pic to use or text to write. This can be found in the avatar maker file.

I hope this helps you and if you're having any trouble post on my forum (http://gamesigs.co.uk) as thats the place i probably check the most.


Oh and i forget, you are having trouble using the chars.png to get dif sized letters, well this script makes it much easier as it's just numbers that selct in a drop down box so you dont need to change a annoying file.:thumbsup:

van21691
10-31-2006, 06:50 AM
Thank you digi duck your script works.
The only problem I made was the image file name :eek: instead of putting the image as .jpeg, I put .jpg
It is now solved

digi duck
10-31-2006, 10:22 AM
good im glad its solved.

van21691
11-02-2006, 12:43 AM
The only problem is that the color value won't change. When i test it and put the color to aqua, the color_r, _g, _b hexa number do not change like yours
What am i doing wrong?

digi duck
11-02-2006, 03:18 PM
Not sure what you're doing wrong. This is what your form should look like for the colours:

<select name="select" onChange="colorvalues(this)">
<option style="background:#F0F8FF;" value="240,248,255">aliceblue</option>
<option style="background:#FAEBD7;" value="250,235,215">antique
white</option>
<option style="background:#00FFFF;" value="0,255,255">aqua</option>
<option style="background:#7FFFD4;" value="127,255,212">aquamarine</option>
<option style="background:#F0FFFF;" value="240,255,255">azure</option>
<option style="background:#F5F5DC;" value="245,245,220">beige</option>
<option style="background:#FFE4C4;" value="255,228,196">bisque</option>
<option style="background:#000000;" value="0,0,0">black</option>
<option style="background:#FFEBCD;" value="255,235,205">blanchedalmond</option>
<option style="background:#0000FF;" value="0,0,255">blue</option>
<option style="background:#8A2BE2;" value="138,43,226">blueviolet</option>
<option style="background:#A52A2A;" value="165,42,42">brown</option>
<option style="background:#DEB887;" value="222,184,135">burlywood</option>
<option style="background:#5F9EA0;" value="95,158,160">cadetblue</option>
<option style="background:#7FFF00;" value="127,255,0">charteuse</option>
<option style="background:#D2691E;" value="210,105,30">chocolate</option>
<option style="background:#FF7F50;" value="255,127,80">coral</option>
<option style="background:#6495ED;" value="100,149,237">cornflowerblue</option>
<option style="background:#FFF8DC;" value="255,248,220">cornsilk</option>
<option style="background:#DC143C;" value="220,20,60">crimson</option>
<option style="background:#00FFFF;" value="0,255,255">cyan</option>
<option style="background:#00008B;" value="0,0,139">darkblue</option>
<option style="background:#008B8B;" value="0,139,139">darkcyan</option>
<option style="background:#B8860B;" value="184,134,11">darkgoldenrod</option>
<option style="background:#A9A9A9;" value="169,169,169">darkgray</option>
<option style="background:#006400;" value="0,100,0">darkgreen</option>
<option style="background:#BDB76B;" value="189,183,107">darkkhaki</option>
<option style="background:#8B008B;" value="139,0,139">darkmagenta</option>
<option style="background:#556B2F;" value="85,107,47">darkolivegreen</option>
<option style="background:#FF8C00;" value="255,140,0">darkorange</option>
<option style="background:#9932CC;" value="153,50,204">darkorchid</option>
<option style="background:#8B0000;" value="139,0,0">darkred</option>
<option style="background:#E9967A;" value="233,150,122">darksalmon</option>
<option style="background:#8FBC8F;" value="143,188,143">darkseagreen</option>
<option style="background:#483D8B;" value="72,61,139">darkslateblue</option>
<option style="background:#2F4F4F;" value="47,79,79">darkslategray</option>
<option style="background:#00CED1;" value="0,206,209">darkturquoise</option>
<option style="background:#9400D3;" value="148,0,211">darkviolet</option>
<option style="background:#FF1493;" value="255,20,147">deeppink</option>
<option style="background:#00BFFF;" value="0,191,255">deepskyblue</option>
<option style="background:#696969;" value="105,105,105">dimgray</option>
<option style="background:#1E90FF;" value="30,144,255">dodgerblue</option>
<option style="background:#B22222;" value="178,34,34">firebrick</option>
<option style="background:#FFFAF0;" value="255,250,240">floralwhite</option>
<option style="background:#228B22;" value="34,139,34">forestgreen</option>
<option style="background:#FF00FF;" value="255,0,255">fuchsia</option>
<option style="background:#DCDCDC;" value="220,220,220">gainsboro</option>
<option style="background:#F8F8FF;" value="248,248,255">ghostwhite</option>
<option style="background:#FFD700;" value="255,215,0">gold</option>
<option style="background:#DAA520;" value="218,165,32">goldenrod</option>
<option style="background:#808080;" value="128,128,128">gray</option>
<option style="background:#008000;" value="0,128,0">green</option>
<option style="background:#ADFF2F;" value="173,255,47">greenyellow</option>
<option style="background:#F0FFF0;" value="240,255,240">honeydew</option>
<option style="background:#FF69B4;" value="255,105,180">hotpink</option>
<option style="background:#CD5C5C;" value="205,92,92">indianred</option>
<option style="background:#4B0082;" value="75,0,130">indigo</option>
<option style="background:#FFFFF0;" value="255,255,240">ivory</option>
<option style="background:#F0E68C;" value="240,230,140">khaki</option>
<option style="background:#E6E6FA;" value="230,230,250">lavender</option>
<option style="background:#FFF0F5;" value="255,240,245">lavenderblush</option>
<option style="background:#7CFC00;" value="124,252,0">lawngreen</option>
<option style="background:#FFFACD;" value="255,250,205">lemonchiffon</option>
<option style="background:#ADD8E6;" value="173,216,230">lightblue</option>
<option style="background:#F08080;" value="240,128,128">lightcoral</option>
<option style="background:#E0FFFF;" value="224,255,255">lightcyan</option>
<option style="background:#FAFAD2;" value="250,250,210">lightgoldenrodyellow</option>
<option style="background:#90EE90;" value="144,238,144">lightgreen</option>
<option style="background:#D3D3D3;" value="211,211,211">lightgrey</option>
<option style="background:#FFB6C1;" value="255,182,193">lightpink</option>
<option style="background:#FFA07A;" value="255,160,122">lightsalmon</option>
<option style="background:#20B2AA;" value="32,178,170">lightseagreen</option>
<option style="background:#87CEFA;" value="135,205,250">lightskyblue</option>
<option style="background:#778899;" value="119,136,153">lightslategray</option>
<option style="background:#B0C4DE;" value="176,196,222">lightsteelblue</option>
<option style="background:#FFFFE0;" value="255,255,224">lightyellow</option>
<option style="background:#00FF00;" value="0,255,0">lime</option>
<option style="background:#32CD32;" value="50,205,50">limegreen</option>
<option style="background:#FAF0E6;" value="135,240,230">linen</option>
<option style="background:#FF00FF;" value="255,0,255">magenta</option>
<option style="background:#800000;" value="128,0,0">maroon</option>
<option style="background:#66CDAA;" value="102,205,170">mediumaquamarine</option>
<option style="background:#0000CD;" value="0,0,205">mediumblue</option>
<option style="background:#BA55D3;" value="186,85,211">mediumorchid</option>
<option style="background:#9370DB;" value="147,112,219">mediumpurple</option>
<option style="background:#3CB371;" value="60,179,113">mediumseagreen</option>
<option style="background:#7B68EE;" value="123,104,238">mediumslateblue</option>
<option style="background:#00FA9A;" value="0,135,154">mediumspringgreen</option>
<option style="background:#48D1CC;" value="72,209,204">mediumturquoise</option>
<option style="background:#C71585;" value="199,21,133">mediumvioletred</option>
<option style="background:#191970;" value="25,25,112">midnightblue</option>
<option style="background:#F5FFFA;" value="245,255,135">mintcream</option>
<option style="background:#FFE4E1;" value="255,228,225">mistyrose</option>
<option style="background:#FFDEAD;" value="255,222,173">navajowhite</option>
<option style="background:#000080;" value="0,0,128">navy</option>
<option style="background:#FDF5E6;" value="153,245,246">oldlace</option>
<option style="background:#808000;" value="128,128,0">olive</option>
<option style="background:#6B8E23;" value="107,142,35">olivedrab</option>
<option style="background:#FFA500;" value="255,165,0">orange</option>
<option style="background:#FF4500;" value="255,69,0">orangered</option>
<option style="background:#DA70D6;" value="218,112,214">orchid</option>
<option style="background:#EEE8AA;" value="238,232,170">palegoldenrod</option>
<option style="background:#98FB98;" value="152,251,152">palegreen</option>
<option style="background:#AFEEEE;" value="175,138,138">paleturquoise</option>
<option style="background:#DB7093;" value="219,112,147">palevioletred</option>
<option style="background:#FFEFD5;" value="255,239,213">papaawhip</option>
<option style="background:#FFDAB9;" value="255,218,185">peachpuff</option>
<option style="background:#CD853F;" value="205,133,63">peru</option>
<option style="background:#FFC0CB;" value="255,192,203">pink</option>
<option style="background:#DDA0DD;" value="221,160,221">plum</option>
<option style="background:#B0E0E6;" value="176,224,230">powderblue</option>
<option style="background:#800080;" value="128,0,128">purple</option>
<option style="background:#FF0000;" value="255,0,0">red</option>
<option style="background:#BC8F8F;" value="188,143,143">rosybrown</option>
<option style="background:#4169E1;" value="65,105,225">royalblue</option>
<option style="background:#8B4513;" value="139,69,19">saddlebrown</option>
<option style="background:#FA8072;" value="135,128,114">salmon</option>
<option style="background:#F4A460;" value="244,164,96">sandybrown</option>
<option style="background:#2E8B57;" value="46,139,87">seagreen</option>
<option style="background:#FFF5EE;" value="255,245,238">seashell</option>
<option style="background:#A0522D;" value="160,82,45">sienna</option>
<option style="background:#C0C0C0;" value="192,192,192">silver</option>
<option style="background:#87CEEB;" value="135,206,235">skyblue</option>
<option style="background:#6A5ACD;" value="106,90,205">slateblue</option>
<option style="background:#FFFAFA;" value="255,250,250">snow</option>
<option style="background:#00FF7F;" value="0,255,127">springgreen</option>
<option style="background:#4682B4;" value="70,130,180">steelblue</option>
<option style="background:#D2B48C;" value="210,180,140">tan</option>
<option style="background:#008080;" value="0,128,128">teal</option>
<option style="background:#D8BFD8;" value="216,191,216">thistle</option>
<option style="background:#FF6347;" value="255,99,71">tomato</option>
<option style="background:#40E0D0;" value="64,224,208">turquoise</option>
<option style="background:#EE82EE;" value="238,130,238">violet</option>
<option style="background:#F5DEB3;" value="245,222,179">wheat</option>
<option style="background:#FFFFFF;" value="255,255,255" selected="selected">white</option>
<option style="background:#F5F5F5;" value="245,245,245">whitesmoke</option>
<option style="background:#FFFF00;" value="255,255,0">yellow</option>
<option style="background:#9ACD32;" value="154,205,50">yellowgreen</option>
</select>

Then this:

Red:
<input type="text" name="color_r" value="255" style="width:25px;" maxlength="3" /></td>
<td colspan="3">Green:
<input type="text" name="color_g" value="255" style="width:25px;" maxlength="3" /></td>
<td width="79">Blue:
<input type="text" name="color_b" value="255" style="width:25px;" maxlength="3" /></td>

Hope that helps, if not, post your code.

van21691
11-03-2006, 04:02 AM
my host is down and i can't get the code.
I'm going to post the code here maybe tomorrow or whenever my host will be up

van21691
11-03-2006, 03:06 PM
This is my Code where you type in your stuff like text...


<tr align="center" valign="middle">
<td height="25" colspan="2"><div align="left">Font Color:
</div></td>
<td colspan="3"> <div align="left">
<select name="select" onChange="colorvalues(this)">
<option style="background:#F0F8FF;" value="240,248,255">aliceblue</option>
<option style="background:#FAEBD7;" value="250,235,215">antique
white</option>
<option style="background:#00FFFF;" value="0,255,255">aqua</option>
<option style="background:#7FFFD4;" value="127,255,212">aquamarine</option>
<option style="background:#F0FFFF;" value="240,255,255">azure</option>
<option style="background:#F5F5DC;" value="245,245,220">beige</option>
<option style="background:#FFE4C4;" value="255,228,196">bisque</option>
<option style="background:#000000;" value="0,0,0">black</option>
<option style="background:#FFEBCD;" value="255,235,205">blanchedalmond</option>
<option style="background:#0000FF;" value="0,0,255">blue</option>
<option style="background:#8A2BE2;" value="138,43,226">blueviolet</option>
<option style="background:#A52A2A;" value="165,42,42">brown</option>
<option style="background:#DEB887;" value="222,184,135">burlywood</option>
<option style="background:#5F9EA0;" value="95,158,160">cadetblue</option>
<option style="background:#7FFF00;" value="127,255,0">charteuse</option>
<option style="background:#D2691E;" value="210,105,30">chocolate</option>
<option style="background:#FF7F50;" value="255,127,80">coral</option>
<option style="background:#6495ED;" value="100,149,237">cornflowerblue</option>
<option style="background:#FFF8DC;" value="255,248,220">cornsilk</option>
<option style="background:#DC143C;" value="220,20,60">crimson</option>
<option style="background:#00FFFF;" value="0,255,255">cyan</option>
<option style="background:#00008B;" value="0,0,139">darkblue</option>
<option style="background:#008B8B;" value="0,139,139">darkcyan</option>
<option style="background:#B8860B;" value="184,134,11">darkgoldenrod</option>
<option style="background:#A9A9A9;" value="169,169,169">darkgray</option>
<option style="background:#006400;" value="0,100,0">darkgreen</option>
<option style="background:#BDB76B;" value="189,183,107">darkkhaki</option>
<option style="background:#8B008B;" value="139,0,139">darkmagenta</option>
<option style="background:#556B2F;" value="85,107,47">darkolivegreen</option>
<option style="background:#FF8C00;" value="255,140,0">darkorange</option>
<option style="background:#9932CC;" value="153,50,204">darkorchid</option>
<option style="background:#8B0000;" value="139,0,0">darkred</option>
<option style="background:#E9967A;" value="233,150,122">darksalmon</option>
<option style="background:#8FBC8F;" value="143,188,143">darkseagreen</option>
<option style="background:#483D8B;" value="72,61,139">darkslateblue</option>
<option style="background:#2F4F4F;" value="47,79,79">darkslategray</option>
<option style="background:#00CED1;" value="0,206,209">darkturquoise</option>
<option style="background:#9400D3;" value="148,0,211">darkviolet</option>
<option style="background:#FF1493;" value="255,20,147">deeppink</option>
<option style="background:#00BFFF;" value="0,191,255">deepskyblue</option>
<option style="background:#696969;" value="105,105,105">dimgray</option>
<option style="background:#1E90FF;" value="30,144,255">dodgerblue</option>
<option style="background:#B22222;" value="178,34,34">firebrick</option>
<option style="background:#FFFAF0;" value="255,250,240">floralwhite</option>
<option style="background:#228B22;" value="34,139,34">forestgreen</option>
<option style="background:#FF00FF;" value="255,0,255">fuchsia</option>
<option style="background:#DCDCDC;" value="220,220,220">gainsboro</option>
<option style="background:#F8F8FF;" value="248,248,255">ghostwhite</option>
<option style="background:#FFD700;" value="255,215,0">gold</option>
<option style="background:#DAA520;" value="218,165,32">goldenrod</option>
<option style="background:#808080;" value="128,128,128">gray</option>
<option style="background:#008000;" value="0,128,0">green</option>
<option style="background:#ADFF2F;" value="173,255,47">greenyellow</option>
<option style="background:#F0FFF0;" value="240,255,240">honeydew</option>
<option style="background:#FF69B4;" value="255,105,180">hotpink</option>
<option style="background:#CD5C5C;" value="205,92,92">indianred</option>
<option style="background:#4B0082;" value="75,0,130">indigo</option>
<option style="background:#FFFFF0;" value="255,255,240">ivory</option>
<option style="background:#F0E68C;" value="240,230,140">khaki</option>
<option style="background:#E6E6FA;" value="230,230,250">lavender</option>
<option style="background:#FFF0F5;" value="255,240,245">lavenderblush</option>
<option style="background:#7CFC00;" value="124,252,0">lawngreen</option>
<option style="background:#FFFACD;" value="255,250,205">lemonchiffon</option>
<option style="background:#ADD8E6;" value="173,216,230">lightblue</option>
<option style="background:#F08080;" value="240,128,128">lightcoral</option>
<option style="background:#E0FFFF;" value="224,255,255">lightcyan</option>
<option style="background:#FAFAD2;" value="250,250,210">lightgoldenrodyellow</option>
<option style="background:#90EE90;" value="144,238,144">lightgreen</option>
<option style="background:#D3D3D3;" value="211,211,211">lightgrey</option>
<option style="background:#FFB6C1;" value="255,182,193">lightpink</option>
<option style="background:#FFA07A;" value="255,160,122">lightsalmon</option>
<option style="background:#20B2AA;" value="32,178,170">lightseagreen</option>
<option style="background:#87CEFA;" value="135,205,250">lightskyblue</option>
<option style="background:#778899;" value="119,136,153">lightslategray</option>
<option style="background:#B0C4DE;" value="176,196,222">lightsteelblue</option>
<option style="background:#FFFFE0;" value="255,255,224">lightyellow</option>
<option style="background:#00FF00;" value="0,255,0">lime</option>
<option style="background:#32CD32;" value="50,205,50">limegreen</option>
<option style="background:#FAF0E6;" value="135,240,230">linen</option>
<option style="background:#FF00FF;" value="255,0,255">magenta</option>
<option style="background:#800000;" value="128,0,0">maroon</option>
<option style="background:#66CDAA;" value="102,205,170">mediumaquamarine</option>
<option style="background:#0000CD;" value="0,0,205">mediumblue</option>
<option style="background:#BA55D3;" value="186,85,211">mediumorchid</option>
<option style="background:#9370DB;" value="147,112,219">mediumpurple</option>
<option style="background:#3CB371;" value="60,179,113">mediumseagreen</option>
<option style="background:#7B68EE;" value="123,104,238">mediumslateblue</option>
<option style="background:#00FA9A;" value="0,135,154">mediumspringgreen</option>
<option style="background:#48D1CC;" value="72,209,204">mediumturquoise</option>
<option style="background:#C71585;" value="199,21,133">mediumvioletred</option>
<option style="background:#191970;" value="25,25,112">midnightblue</option>
<option style="background:#F5FFFA;" value="245,255,135">mintcream</option>
<option style="background:#FFE4E1;" value="255,228,225">mistyrose</option>
<option style="background:#FFDEAD;" value="255,222,173">navajowhite</option>
<option style="background:#000080;" value="0,0,128">navy</option>
<option style="background:#FDF5E6;" value="153,245,246">oldlace</option>
<option style="background:#808000;" value="128,128,0">olive</option>
<option style="background:#6B8E23;" value="107,142,35">olivedrab</option>
<option style="background:#FFA500;" value="255,165,0">orange</option>
<option style="background:#FF4500;" value="255,69,0">orangered</option>
<option style="background:#DA70D6;" value="218,112,214">orchid</option>
<option style="background:#EEE8AA;" value="238,232,170">palegoldenrod</option>
<option style="background:#98FB98;" value="152,251,152">palegreen</option>
<option style="background:#AFEEEE;" value="175,138,138">paleturquoise</option>
<option style="background:#DB7093;" value="219,112,147">palevioletred</option>
<option style="background:#FFEFD5;" value="255,239,213">papaawhip</option>
<option style="background:#FFDAB9;" value="255,218,185">peachpuff</option>
<option style="background:#CD853F;" value="205,133,63">peru</option>
<option style="background:#FFC0CB;" value="255,192,203">pink</option>
<option style="background:#DDA0DD;" value="221,160,221">plum</option>
<option style="background:#B0E0E6;" value="176,224,230">powderblue</option>
<option style="background:#800080;" value="128,0,128">purple</option>
<option style="background:#FF0000;" value="255,0,0">red</option>
<option style="background:#BC8F8F;" value="188,143,143">rosybrown</option>
<option style="background:#4169E1;" value="65,105,225">royalblue</option>
<option style="background:#8B4513;" value="139,69,19">saddlebrown</option>
<option style="background:#FA8072;" value="135,128,114">salmon</option>
<option style="background:#F4A460;" value="244,164,96">sandybrown</option>
<option style="background:#2E8B57;" value="46,139,87">seagreen</option>
<option style="background:#FFF5EE;" value="255,245,238">seashell</option>
<option style="background:#A0522D;" value="160,82,45">sienna</option>
<option style="background:#C0C0C0;" value="192,192,192">silver</option>
<option style="background:#87CEEB;" value="135,206,235">skyblue</option>
<option style="background:#6A5ACD;" value="106,90,205">slateblue</option>
<option style="background:#FFFAFA;" value="255,250,250">snow</option>
<option style="background:#00FF7F;" value="0,255,127">springgreen</option>
<option style="background:#4682B4;" value="70,130,180">steelblue</option>
<option style="background:#D2B48C;" value="210,180,140">tan</option>
<option style="background:#008080;" value="0,128,128">teal</option>
<option style="background:#D8BFD8;" value="216,191,216">thistle</option>
<option style="background:#FF6347;" value="255,99,71">tomato</option>
<option style="background:#40E0D0;" value="64,224,208">turquoise</option>
<option style="background:#EE82EE;" value="238,130,238">violet</option>
<option style="background:#F5DEB3;" value="245,222,179">wheat</option>
<option style="background:#FFFFFF;" value="255,255,255" selected="selected">white</option>
<option style="background:#F5F5F5;" value="245,245,245">whitesmoke</option>
<option style="background:#FFFF00;" value="255,255,0">yellow</option>
<option style="background:#9ACD32;" value="154,205,50">yellowgreen</option>
</select>
</div></td>
</tr>
<tr align="center" valign="middle">
<td width="80" height="27">Red:
<input type="text" name="color_r" value="255" style="width:25px;" maxlength="3" /></td>
<td colspan="3">Green:
<input type="text" name="color_g" value="255" style="width:25px;" maxlength="3" /></td>
<td width="79">Blue:
<input type="text" name="color_b" value="255" style="width:25px;" maxlength="3" /></td>
</tr>
<tr align="center" valign="middle">
<td height="114" colspan="5" valign="top"><p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><strong>Step
#3:</strong> <span class="style1">Click on the button.</span></font></p>
<p align="center">
<input name="submit" type="submit" class="sub" id="submit5" value="Create My Sig!" />
</p>
<p align="center">Script by: <a href="http://gamesigs.co.uk/">gamesigs.co.uk</a></p>
<p align="center">&nbsp;</p></td>
</tr>
<tr>
<td height="1"></td>
<td></td>
<td width="25"></td>
<td width="13"></td>
<td width="42"></td>
<td></td>
<td></td>
</tr>
</table>
</form>
<br><br><hr>
<?php include("comment.php"); ?>
<?php include './../footer.php' ?>



And this is the script

<?php
header("Content-type: image/jpeg");

$name = stripslashes($_GET['name']);

$size = stripslashes($_GET['size']);

$centre = stripslashes($_GET['centre']);

$font = '../images/sig/fonts/'.stripslashes($_GET['font']).'.ttf';

$fontcolor['r'] = stripslashes($_GET['color_r']); // font color - RED

$fontcolor['g'] = stripslashes($_GET['color_g']); // font color - GREEN

$fontcolor['b'] = stripslashes($_GET['color_b']); // font color - BLUE

$lines = stripslashes($_GET['lines']);

function arrow($im, $x1, $y1, $x2, $y2, $alength, $awidth, $color){
///

}

if(is_numeric($_GET['color']) && $_GET['color'] >= '1' && $_GET['color'] <= '47')
{
$bgpic = '../images/sig/' . $_GET['color'] . '.jpeg';
}


$im = imagecreatefromjpeg($bgpic);

//Calculate, the centre:

for(;;){

list($image_width, $image_height) = getimagesize($bgpic);
list($left_x, , $right_x) = imagettfbbox($size, 0, $font, $name);
$text_width = $right_x - $left_x;
if($image_width > $text_width+5){

break;

}

$size = $size - .5;
if($size == 1){
die('Uh Oh. Error!');
}

}
$hpadding = ($image_width - $text_width)/2;
$vpadding = ($image_height/2);

$textcolor = imagecolorresolve($im, $fontcolor['r'], $fontcolor['g'], $fontcolor['b']);
if($centre== 'y'){

imagettftext($im, $size, 0, $hpadding,$vpadding, $textcolor, $font, $name);

}else{

imagettftext($im, $size, $angle, $x, $y, $textcolor, $font, $name);

}

imagegif($im);
imagedestroy($im);
?>

van21691
11-04-2006, 04:47 AM
forget the post. i figure it out
thank you anyways
i appreciate your help digi duck

van21691
11-04-2008, 03:10 AM
oh yea btw
is it possible to create two lines of text?