瀏覽代碼

merge alpha fix from svn://svn.zoy.org/libcaca/libcaca/trunk/caca-php/examples/export.php@3287 into examples/www/export.php

tags/v0.99.beta17
Ben Wiley Sittler bsittler 16 年之前
父節點
當前提交
24ca7502e6
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. +3
    -1
      caca-php/examples/www/export.php

+ 3
- 1
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));
}
}



Loading…
取消
儲存