note 103179 deleted from function.imagecolortransparent by danbrown
| From: | danbrown@php.net | Date: | Wed, 30 Mar 2011 14:03:53 +0000 |
| Subject: | note 103179 deleted from function.imagecolortransparent by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-178341@lists.php.net to get a copy of this message | ||
Note Submitter: nadim at alienworkers dot com
----
The code provided above (Example #1 imagecolortransparent() example) does not cater for alpha
transparency in PNG images.
I've got a working code from akemapa.com/2008/07/10/php-gd-resize-transparent-image-png-gif/
<?php
$img_new = @imagecreatetruecolor($new_img_width, $new_img_height);
imagealphablending($img_new, false);
imagesavealpha($img_new, true);
$transparent = imagecolorallocatealpha($img_new, 255, 255, 255, 127);
imagefilledrectangle($img_new, 0, 0, $new_img_width, $new_img_height, $transparent);
?>