note 43024 added to function.imagecreatefrompng

From: Date: Mon, 07 Jun 2004 08:14:13 +0000
Subject: note 43024 added to function.imagecreatefrompng
Groups: php.notes 
Request: Send a blank email to php-notes+get-70757@lists.php.net to get a copy of this message
If you're trying to load a translucent png-24 image but are finding an absence of transparency (like it's black), you need to enable alpha channel AND save the setting. I'm new to GD and it took me almost two hours to figure this out. <?php $imgPng = imageCreateFromPng($strImagePath); imageAlphaBlending($imgPng, true); imageSaveAlpha($imgPng, true); /* Output image to browser */ header("Content-type: image/png"); imagePng($imgPng); ?> ---- Manual Page -- http://www.php.net/manual/en/function.imagecreatefrompng.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+43024 Delete -- http://master.php.net/manage/user-notes.php?action=delete+43024&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+43024&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#70757) next »