Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Przeźroczyste tło dla PNG24 przy uzyciu GD, funkcja imagecopy
--michu--
post
Post #1





Goście







Witam,
problem jest nastepujacy mam skrypt, który wstawia przezroczytego pnga. Wszystko jest ok o ile ten png nie jest PNG24. Wowczas przeźroczyta czesc obrazka zamienia sie w biala czesc. Korzystam z funkcji imagecopy. PNG przgotowywuje w photosgopie. Czy da sie to jakos ominac?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
--michu--
post
Post #2





Goście







DALEJ NIESTEY IMPORTOWANY OBRAZEK MA BIALE TLO (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

  1. <?php
  2.  
  3.  
  4. $width = 200;
  5. $height = 200;
  6.  
  7.  
  8. header("Content-type: image/png");
  9.  
  10. $image = imagecreate( $width, $height );
  11.  
  12.  
  13. $blue_bok = imagecolorallocate($image, 59,154,220 );
  14. imagefilledrectangle($image, 0, 0, 200, 200, $blue_bok);
  15.  
  16. $ramka = imagecreatefrompng("g.png");
  17. imagefilledrectangle($ramka,0,0,200,200,imagecolorallocatealpha($ramka,255,255,255,255));
  18. imagecopy($image, $ramka, 10, 10, 0, 0, 116, 116);
  19.  
  20. imagepng($image);
  21.  
  22.  
  23. ?>
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: 16.10.2025 - 07:19