Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Tworzenie grafik
MrDziobak
post
Post #1





Grupa: Zarejestrowani
Postów: 24
Pomógł: 0
Dołączył: 28.08.2012

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


Witam mam taki o to kod
  1. $im = imagecreatefrompng("bg.png");
  2. $white = imagecolorallocate($im, 0, 0, 0);
  3. $green = imagecolorallocate($im, 30, 255, 0);
  4. imagettftext($im, 10, 0, 3, 24, $white, MINE, "Cos tam");
  5. imagettftext($im, 10, 0, 155, 24, $white, MINE, "Cos tam");
  6. header('Content-type: image/png');
  7. imagepng($im);
  8. imagedestroy($im);


I chciałbym wstawić obok grafikę która znajduje się na http://example.com/przykladowyskrypt.php?user=Dziobak
Lecz nie zbyt wiem w jaki sposób to zrobić. Bardzo prosił bym o pomoc, jest do dla mnie bardzo ważne.

Ten post edytował MrDziobak 22.05.2013, 15:31:35
Go to the top of the page
+Quote Post
Kshyhoo
post
Post #2





Grupa: Opiekunowie
Postów: 3 855
Pomógł: 317
Dołączył: 4.01.2005
Skąd: że




To zależy, co chcesz zrobić. Ja polecam funkcję ImageCopyResampled().
  1. $im = imagecreatefrompng("bg1.png");
  2. $im1 = imagecreatefrompng("bg2.png");
  3.  
  4. ImageCopyResampled($im,$im1, 0, 0, 0, 0,500,500,500,500);
  5.  
  6. $white = imagecolorallocate($im, 0, 0, 0);
  7. $green = imagecolorallocate($im, 30, 255, 0);
  8. imagettftext($im, 10, 0, 3, 24, $white, "arial.ttf", "Cos tam");
  9. imagettftext($im, 10, 0, 155, 24, $green, "arial.ttf", "Cos tam");
  10. header('Content-type: image/png');
  11. imagepng($im);
  12. imagedestroy($im);


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 08:57