PLEASE RELOAD
Sig Comp Step-by-Step



Step Three
Now let's annotate our name on it. And let's do it with a drop shadow. We want some colors for the name so we designate some. You can put as many colors here as you want, just follow the same format. This block of designated colors must be above whatever you want to use them for; so it is best to put them at the top, right under your image import.

//COLOR VARIABLES

$grey = imagecolorAllocate($im, 128, 128, 128);
$black =imagecolorallocate($im, 0, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
$lace = ImageColorAllocate($im, 253, 245, 230);
$goldenrod = ImageColorAllocate($im, 218, 165, 32);

Here's where we annotate. First is what you want to say, and second is the font. The font must be in the same directory for now just for simplification. You may grab the font below or use one of your own.

$text = 'Sally';

$font = 'Admiral.ttf';

The next two lines write the dropshadow and the name. The top one is the dropshadow. The 26 is the point size of the font. The zero is the angle if you want your font to slant one way or another and it may be a negative number. The last two numbers are the X and Y position where your annotation will begin. Next is where we put the colors to use; the font and what to write

imagettftext($im, 26, 0, 172, 52, $black, $font, $text);

imagettftext($im, 26, 0, 170, 50, $lace, $font, $text);



Here's my completed image.



Now I'll take out the two slashes before the output and let it become an image in my FM. This is now a basic signature script that you can use over and over if you want to import an image. The next step will show you how to make your own background tag, and make a decorative border for it.

Lounge with Annotate

Font

Page 4


GD BasicsHome