2
Header("Content-type: image/png");
3
$string=implode($argv," ");
4
$im = imageCreateFromPng("images/button1.png");
5
$orange = ImageColorAllocate($im, 220, 210, 60);
6
$px = (imagesx($im)-7.5*strlen($string))/2;
7
ImageString($im,3,$px,9,$string,$orange);
12
This example would be called from a page with a tag like: <img
13
src="button.php?text"> The above button.php script then takes this "text"
14
string an overlays it on top of a base image which in this case is
15
"images/button1.png" and outputs the resulting image. This is a very
16
convenient way to avoid having to draw new button images every time you want
17
to change the text of a button. With this method they are dynamically