01.
<html>
02.
<head>
03.
<title>ThaiCreate.Com PHP Upload Write Text</title>
04.
</head>
05.
<body>
06.
<?php
07.
if
(trim(
$_FILES
[
"fileUpload"
][
"tmp_name"
]) !=
""
)
08.
{
09.
echo
"<img src=MyResize/mygirl.png>"
;
10.
$font
=
'ANGSAZ.TTF'
;
11.
$string
=
"Narak Girl By ThaiCreate.Com"
;
12.
$im
= ImageCreateFromJpeg(
$_FILES
[
"fileUpload"
][
"tmp_name"
]);
13.
$color
= ImageColorAllocate(
$im
, 255, 0, 0);
14.
$pxX
= (Imagesx(
$im
) - 4 *
strlen
(
$string
))/2;
15.
$pxY
= Imagesy(
$im
)- 10;
16.
ImagettfText(
$im
, 20, 0,
$pxX
,
$pxY
,
$color
,
$font
,
$string
);
17.
imagePng(
$im
,
"MyResize/mygirl.png"
);
18.
19.
ImageDestroy(
$im
);
20.
}
21.
?>
22.
</body>
23.
</html>