<html> <head> <title>ThaiCreate.Com PHP Upload Write Text</title> </head> <body> <form action="phpUploadWriteText.php" method="post" enctype="multipart/form-data" name="frmMain"> <table width="343" border="1"> <tr> <td>Upload</td> <td><input name="fileUpload" type="file"></td> </tr> <tr> <td> </td> <td><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </form> </body> </html>
<html> <head> <title>ThaiCreate.Com PHP Upload Write Text</title> </head> <body> <?php if(trim($_FILES["fileUpload"]["tmp_name"]) != "") { echo "<img src=MyResize/mygirl.png>"; $font = 'ANGSAZ.TTF'; $string = "Narak Girl By ThaiCreate.Com"; // String $im = ImageCreateFromJpeg($_FILES["fileUpload"]["tmp_name"]); // Path From Upload Temp $color = ImageColorAllocate($im, 255, 0, 0); // Text Color $pxX = (Imagesx($im) - 4 * strlen($string))/2; // X $pxY = Imagesy($im)- 10; // Y ImagettfText($im, 20, 0, $pxX, $pxY, $color, $font, $string); imagePng($im,"MyResize/mygirl.png"); //imageJpeg($im,"MyResize/mygirl.png"); ImageDestroy($im); } ?> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท