İnternet Programlama Dersi – 1 (Güz-2017) Hafta – 12 – 4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
<?php if(count($_POST)>0) { if(isset($_FILES["dosya"])) { if($_FILES["dosya"]["type"]=="image/png") { $link = $_FILES["dosya"]["tmp_name"]; $size=getimagesize($link); $genisliky=(int)($size[0]/2); $yuksekliky=(int)($size[1]/2); $src= imagecreatefrompng($link); $renk = imagecolorallocate($src, 255, 0, 0); //imagestring($src, 10, $genisliky, $yuksekliky, // "DENEME", $renk); imagettftext($src, 50, 45, $genisliky, $yuksekliky, $renk, "./abc.ttf", "DENEME"); imagepng($src,"yeni.png"); imagedestroy($src); echo "resim kaydedildi!"; } } } ?> <html> <head> <title>Dosya Yükleme</title> <meta charset="UTF-8"> </head> <body> <form method="post" enctype="multipart/form-data"> Dosya Seçin: <input type="file" name="dosya" id="dosya" required><br> <input type="submit" name="gonder" value="Gönder"> </form> </body> </html> |
Okumaya devam et
Son Yorumlar