File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
gd /
tests /
imagecolorallocatealpha_basic.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:47:56 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
Testing imagecolorallocatealpha()
--CREDITS--
Rafael Dohms <rdohms [at] gmail [dot] com>
--SKIPIF--
<?php
if (!extension_loaded("gd")) die("skip GD not present");
?>
--FILE--
<?php
$img = imagecreatetruecolor(150, 150);
$cor = imagecolorallocate($img, 50, 100, 255);
$corA = imagecolorallocatealpha($img, 50, 100, 255, 50);
//$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127);
$half = imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE );
$half2 = imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE );
ob_start();
imagepng($img, null, 9);
$imgsrc = ob_get_contents();
ob_end_clean();
var_dump(md5(base64_encode($imgsrc)));
var_dump($corA);
?>
--EXPECT--
string(32) "b856a0b1a15efe0f79551ebbb5651fe8"
int(842163455)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>