Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Biblioteka gd -napis i wersja
Kamil9132
post
Post #1





Grupa: Zarejestrowani
Postów: 210
Pomógł: 0
Dołączył: 7.11.2010

Ostrzeżenie: (10%)
X----


Witam
Mam taki kod:
  1. <?php
  2. // Set the content-type
  3. header('Content-type: image/png');
  4.  
  5. // Create the image
  6. $im = imagecreatetruecolor(400, 30);
  7.  
  8. // Create some colors
  9. $white = imagecolorallocate($im, 255, 255, 255);
  10. $grey = imagecolorallocate($im, 128, 128, 128);
  11. $black = imagecolorallocate($im, 0, 0, 0);
  12. imagefilledrectangle($im, 0, 0, 399, 29, $white);
  13.  
  14. // The text to draw
  15. $text = 'Testing...';
  16. // Replace path by your own font path
  17. $font = 'arial.ttf';
  18.  
  19. // Add some shadow to the text
  20. imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
  21.  
  22. // Add the text
  23. imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
  24.  
  25. // Using imagepng() results in clearer text compared with imagejpeg()
  26. imagepng($im);
  27. imagedestroy($im);
  28. ?>


Skopiowałem go bezpośrednio z manuala ,ale nie działa (IMG:style_emoticons/default/sad.gif)
Mam wersje php 5.2.17 i wersje gd 2.0.35.
Czemu to nie działa (IMG:style_emoticons/default/questionmark.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 17.09.2025 - 23:42