Altta bulunan Php kodu sayesinde resim üzerine yazı yazabilirsiniz.

  1. <?php
  2. // Dosya Türü
  3. header(“Content-type: image/png”);
  4. // Resim oluşturuluyor
  5. $im = imagecreatetruecolor(400, 30);
  6. // Renkler oluşturuluyor
  7. $white = imagecolorallocate($im, 255, 255, 255);
  8. $grey = imagecolorallocate($im, 128, 128, 128);
  9. $black = imagecolorallocate($im, 0, 0, 0);
  10. imagefilledrectangle($im, 0, 0, 399, 29, $white);
  11. // Yazı yazılıyor
  12. $text = ‘Deneme…’;
  13. // Font seçiliyor
  14. $font = ‘arial.ttf’;
  15. // Yazıya gölge ekleneiyor
  16. imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
  17. // Resim üzerine yazı ekleniyor
  18. imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
  19. // Using imagepng() results in clearer text compared with imagejpeg()
  20. imagepng($im);
  21. imagedestroy($im);
  22. ?>