Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> przezroczystość w tworzeniu obrazka php pod png
marcinvx
post
Post #1





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

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


  1. http://gold-racing.pl/a.png?ip=localhost&port=22

a
  1. http://gold-racing.pl/a.png?ip=localhost&port=224242


Co jest nie tak w kodzie ze jak on to pokazuje z przezroczystością a jak off to tło jest czarne ?
obrazki:
  1. http://gold-racing.pl/on2.png

  1. http://gold-racing.pl/off2.png

  1. <?php
  2. $online = @fsockopen($_GET["ip"], $_GET["port"], $errno, $errstr, 1);
  3. if (!$online) {
  4. $avatar = imagecreatefrompng( 'off2.png' );
  5. header( 'Content-type: image/png' );
  6. imagepng( $avatar );
  7. imagedestroy( $avatar );
  8. }
  9. else {
  10. $avatar = imagecreatefrompng( 'on2.png' );
  11. header( 'Content-type: image/png' );
  12. imagepng( $avatar );
  13. imagedestroy( $avatar );
  14. }
  15. @fclose($online);
  16. ?>
Go to the top of the page
+Quote Post
bim2
post
Post #2





Grupa: Zarejestrowani
Postów: 1 873
Pomógł: 152
Dołączył: 9.04.2006
Skąd: Berlin

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


Ale do czego tutaj ma służyć biblioteka GD? Skoro i tak nic w obrazku nie zmieniasz?
Zrób tak:
  1. header( 'Content-type: image/png' );
  2. echo file_get_contents( 'off2.png');


--------------------
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: 20.08.2025 - 16:50