From 24ca7502e6cc75536ac1bb2b638428ea0d952087 Mon Sep 17 00:00:00 2001 From: Ben Wiley Sittler Date: Tue, 4 Nov 2008 23:56:43 +0000 Subject: [PATCH] merge alpha fix from svn://svn.zoy.org/libcaca/libcaca/trunk/caca-php/examples/export.php@3287 into examples/www/export.php --- caca-php/examples/www/export.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caca-php/examples/www/export.php b/caca-php/examples/www/export.php index 8afc019..f718ac6 100644 --- a/caca-php/examples/www/export.php +++ b/caca-php/examples/www/export.php @@ -21,6 +21,8 @@ define('WIDTH', 80); define('HEIGHT', 32); $pixels = imagecreatetruecolor(256, 256); +imagealphablending($pixels, false); +imagesavealpha($pixels, true); $exports = caca_get_export_list(); @@ -125,7 +127,7 @@ else $r = $x; $g = (255 - $y + $x) / 2; $b = $y * (255 - $x) / 256; - imagesetpixel($pixels, $x, $y, imagecolorallocate($pixels, $r, $g, $b)); + imagesetpixel($pixels, $x, $y, imagecolorallocatealpha($pixels, $r, $g, $b, 127)); } }