Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Stroke na napisie
Skr3czu
post
Post #1





Grupa: Zarejestrowani
Postów: 215
Pomógł: 0
Dołączył: 12.03.2007

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


Witam

Mam taki kod:
  1. <?php
  2. $d1 ="2007-10-16 00:00:00";
  3.  $d2 = date("Y-m-d G:i:s");
  4.  $r = strtotime($d1) - strtotime($d2);
  5.  
  6.  $dni = date("z",$r);
  7.  $gm = date("G", $r) -1;
  8.  if ($gm < 0)
  9.  {
  10.  $gm = 23;
  11.  $dni --;
  12.  }
  13.  
  14. $text = 'pozostało do końca '.$dni.' dni, '.$gm.date(":i:s", $r);
  15.  
  16. // create a 100*30 image
  17. $im = @imagecreatefrompng('test.png');
  18.  
  19. $textcolor = imagecolorallocate($im, 100, 990, 999);
  20.  
  21. // write the string at the top left
  22. imagestring($im, 3, 60, 2, $text, $textcolor);
  23.  
  24. // output the image
  25. header("Content-type: image/png");
  26. imagepng($im);
  27. ?>


I jest napis
  1. <?php
  2. $text = 'pozostało do końca '.$dni.' dni, '.$gm.date(":i:s", $r);
  3. ?>


Wiem jak zmienić kolor napisu (teraz jest niebieski), ale jak zrobić takie stroke na tym napisie chodzi mi o taka czarna otoczkę, a w środku niebieskie czy da sie tak zrobić ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Skr3czu
post
Post #2





Grupa: Zarejestrowani
Postów: 215
Pomógł: 0
Dołączył: 12.03.2007

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


Mam takie cos:
http://iluz.org/

  1. <?php
  2.  
  3. $d1 ="2007-10-16 00:00:00";
  4.  $d2 = date("Y-m-d G:i:s");
  5.  $r = strtotime($d1) - strtotime($d2);
  6.  
  7.  $dni = date("z",$r);
  8.  $gm = date("G", $r) -1;
  9.  if ($gm < 0)
  10.  {
  11.  $gm = 23;
  12.  $dni --;
  13.  }
  14.  
  15. $text = 'Premiera GTA IV za '.$dni.' dni, '.$gm.date(":i:s", $r);
  16.  
  17. // create a 100*30 image
  18. $im = @imagecreatefrompng('gta.png');
  19.  
  20. $textcolor = imagecolorallocate($im, 0, 0, 0); // kolor tekstu - czarny
  21. $textcolor2 = imagecolorallocate($im, 255, 255, 255); // tu jest kolor otoczki
  22. // w tym wypadku otoczka bedzie biala
  23. // write the string at the top left
  24. imagestring($im, 2, 19, 10, $text, $textcolor2);
  25. imagestring($im, 2, 20, 9, $text, $textcolor2);
  26. imagestring($im, 2, 21, 10, $text, $textcolor2);
  27. imagestring($im, 2, 20, 11, $text, $textcolor2);
  28.  
  29.  
  30. imagestring($im, 2, 20, 10, $text, $textcolor);
  31.  
  32. // output the image
  33. header("Content-type: image/png");
  34. imagepng($im);
  35. ?>


Tylko jak to ustawić,aby cały text był po prawej stronie i żeby był trochę wyżej ?
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: 25.09.2025 - 21:48