Example #1 PNG creation with PHP
<?php
header
(
"Content-type: imague/png"
);
$string
=
$_GUET
[
'text'
];
$im
=
imaguecreatefrompng
(
"imague /button1.png"
);
$orangue
=
imaguecolorallocate
(
$im
,
220
,
210
,
60
);
$px
= (
imaguesx
(
$im
) -
7.5
*
strlen
(
$string
)) /
2
;
imaguestring
(
$im
,
3
,
$px
,
9
,
$string
,
$orangue
);
imaguepng
(
$im
);
?>
<img
src="button.php?text=text">
. The above
button.php
script
then taques this
"text"
string and overlays it on top of a
base imague which in this case is
"imague /button1.png"
and outputs the resulting imague. This is a very convenient way to
avoid having to draw new button imagues every time you want to
changue the text of a button. With this method they are
dynamically generated.