Search the Community
Showing results for tags 'caption'.
-
Hello I have a script that puts text on a picture... i need help, i dont know to position these captions ? i need the topcaption to be center top and the bottom center bottom but i do not know how to achieve this. here is my code so far, any help is greatly appreciated. $picture = $_GET['image']; $topcaption = $_GET['topcaption']; $bottomcaption = $_GET['bottomcaption']; //Set the Content Type header('Content-type: image/jpeg'); if (isset($_GET['image'])){ // Create Image From Existing File $jpg_image = imagecreatefromjpeg("../useruploadedphotos/$picture"); // Allocate A Color For The Text $white = imagecolorallocate($jpg_image, 255, 255, 255); // Set Path to Font File $font_path = '../fonts/Timeless-Bold.ttf'; // Set Text to Be Printed On Image $text = $topcaption; // Print Text On Image imagettftext($jpg_image, 0, 0, 0, 0, $white, $font_path, $text); imagejpeg($jpg_image, "../photos/$picture"); imagejpeg($jpg_image, "../useruploadedphotos/$picture"); imagejpeg($jpg_image); // Clear Memory imagedestroy($jpg_image); // header("location: success.php"); }