Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> grafika, tak tak, dział dobry.. ;)
marcinvx
post
Post #1





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 11.02.2011

Ostrzeżenie: (0%)
-----


  1. <?php
  2. // Create a 300x100 image
  3. $im = imagecreatetruecolor(300, 100);
  4. $red = imagecolorallocate($im, 0xFF, 0x00, 0x00);
  5. $black = imagecolorallocate($im, 0x00, 0x00, 0x00);
  6.  
  7. // Make the background red
  8. imagefilledrectangle($im, 0, 0, 299, 99, $red);
  9.  
  10. // Path to our ttf font file
  11. $font_file = './arial.ttf';
  12.  
  13. // Draw the text 'PHP Manual' using font size 13
  14. imagefttext($im, 13, 0, 105, 55, $black, $font_file, 'PHP Manual');
  15.  
  16. // Output image to the browser
  17. header('Content-Type: image/png');
  18.  
  19. imagepng($im);
  20. imagedestroy($im);
  21. ?>

Jak zrobić że zamiast czarnego tła jest obrazek ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
marcinvx
post
Post #2





Grupa: Zarejestrowani
Postów: 19
Pomógł: 0
Dołączył: 11.02.2011

Ostrzeżenie: (0%)
-----


Mam tak:
  1. <?php
  2. // Create image instances
  3. $dest = imagecreatefromgif('sygnaturka.gif');
  4. $src = imagecreatefromgif('sygnaturka.gif');
  5.  
  6. // Copy and merge
  7. imagecopymerge($dest, $src, 10, 10, 0, 0, 0, 452, 122);
  8.  
  9.  
  10. $red = imagecolorallocate($src, 0xFF, 0x00, 0x00);
  11.  
  12. $font_file = './arial.ttf';
  13.  
  14. // Draw the text 'PHP Manual' using font size 13
  15.  
  16. imagefttext($src, 13, 0, 105, 55, $red, $font_file, 'PHP Manual');
  17. // Output and free from memory
  18. header('Content-Type: image/gif');
  19. imagegif($dest);
  20.  
  21. imagedestroy($dest);
  22. imagedestroy($red);
  23. imagedestroy($src);
  24. imagedestroy($font_file);
  25. ?>


Zadne błędy nie wyskakują, ale text sie na obrazu nie pokazuje. ;/
help me. ;D

Ten post edytował marcinvx 22.02.2011, 21:14:42
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: 4.10.2025 - 19:44