DevKB
Web Development Knowledge Base
HOME | TOP 20 | WRITE AN ARTICLE |
Sections :



RSS RSS Feed

You too, please publish your useful code snippets in any programming language :
write an article !


Valid HTML 4.0 Transitional

Plateforme d'envoi de gros fichiers en ligne
Dépannage site web
Blog infogérance
Hébergement e-mail

Olivier Ligny - - 11/03/2008 - vue 7083 fois

Créer une image PNG 32 bits (canal alpha) avec PHP et GD

Si vous tentez de créer une image PNG avec de la transparence partielle en PHP (canal alpha permettant d'attribuer une opacité donnée pixel par pixel), vous verrez que ça n'est pas possible sans un petit parmétrage :

$img = imagecreatetruecolor(128,64);

imagealphablending($img, false);
imagesavealpha($img, true);

...

imagepng($img);




Write a comment :
Your name :     E-mail (optional) :

AntiSpam : what animal is visible on this picture ? :

Nos partenaires : iPhone 8 Cases & Protection