Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Obrazek png z danymi
Forum PHP.pl > Forum > PHP
Lethys
Jak mozna zrobic taki banner






Od strony kodu oczywiscie tongue.gif
Vogel
mamy gotowy obrazek (zielone tlo, napis forum.nasze.net itp.) a potem dodajemy te teksty ktore sa po prawej (online: 1 itd.) przy pomocy biblioteki GD.
LBO
Image functions
Zainteresuj się np. fukcją imagettftext" title="Zobacz w manualu php" target="_manual
Lethys
Mam rysunek png w image/banner.png


i plik php banner.php



  1. <?php
  2. // Set the content-type
  3. header("Content-type: image/banner.png");
  4.  
  5. // Create the image
  6. $im = imagecreatetruecolor(300, 70);
  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. ?>




I nie wiem co dalej ;/
Vogel
zamiast
  1. <?php
  2. $im = imagecreatetruecolor(300, 70);
  3. ?>



daj
  1. <?php
  2. $im = imagecreatefrompng("image/banner.png");
  3. ?>
Lethys
Jak wchodze na www.(...)/banner.php

to mi sie wlacza sciaganie tego pliku php mad.gif a jak


www.(...)/image/banner.png

to nic zwykly obrazek
Cysiaczek
  1. <?php
  2. header ("Content-type: image/png");
  3. ?>

a nie

  1. <?php
  2. header ("Content-type: image/banner.png");
  3. ?>
Lethys
To jest zmienione ale nic nie daje
Vogel
znacyz dales
  1. <?php
  2. header ("Content-type: image/png");
  3. ?>

i nadal nie dziala? nie wierze...
xblant
a masz wogule obsluge php jak nie to mozesz nie zrobic biggrin.gif
Lethys
obczaicie adres :

http://lethys.xxl-web.pl/banner.php


Banner.php

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


A tu link do obrazka

http://lethys.xxl-web.pl/image/banner.png
zur887
byś zajrzał do źródła tego wywalanego obrazka... blinksmiley.gif

niedodałeś czcionki na serwer: "arial.ttf" dry.gif
NetJaro
Są przecież gotowe skrypty do wyświetlania statystyk forum na bannerach..
Lethys
Cytat(zur887 @ 4.07.2006, 22:06 ) *
byś zajrzał do źródła tego wywalanego obrazka... blinksmiley.gif

niedodałeś czcionki na serwer: "arial.ttf" dry.gif



Po dodaniu i tak jest ten sam blad .


Cytat
Są przecież gotowe skrypty do wyświetlania statystyk forum na bannerach..


Ale to nie ma byc banner forum tylko serwisu z filmikami tongue.gif
zur887
no tak, zależy gdzie dodałeś tiredsmiley.gif

mi to piknie wychodzi, jeśli wogule coś miało z tego wyjść laugh.gif

no, coś takiego masz z tego:
cool.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.