Сирожиддин
Uz_MasteR,
  1. <?php
  2. //Set the Content Type
  3. header('Content-type: image/jpeg');
  4.  
  5. // Create Image From Existing File
  6. $jpg_image = imagecreatefromjpeg('sunset.jpg');
  7.  
  8. // Allocate A Color For The Text
  9. $white = imagecolorallocate($jpg_image, 255, 255, 255);
  10.  
  11. // Set Path to Font File
  12. $font_path = 'font.TTF';
  13.  
  14. // Set Text to Be Printed On Image
  15. $text = "This is a sunset!";
  16.  
  17. // Print Text On Image
  18. imagettftext($jpg_image, 25, 0, 75, 300, $white, $font_path, $text);
  19.  
  20. // Send Image to Browser
  21. imagejpeg($jpg_image);
  22.  
  23. // Clear Memory
  24. imagedestroy($jpg_image);
  25. ?>