Annotation of embedaddon/php/ext/gd/tests/imagecolorallocatealpha_basic.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Testing imagecolorallocatealpha()
                      3: --CREDITS--
                      4: Rafael Dohms <rdohms [at] gmail [dot] com>
                      5: --SKIPIF--
                      6: <?php 
                      7:        if (!extension_loaded("gd")) die("skip GD not present");
                      8: ?>
                      9: --FILE--
                     10: <?php
                     11: $img = imagecreatetruecolor(150, 150);
                     12: 
                     13: $cor = imagecolorallocate($img, 50, 100, 255);
                     14: $corA = imagecolorallocatealpha($img, 50, 100, 255, 50);
                     15: //$whiteA = imagecolorallocatealpha($img, 255, 255, 255, 127);
                     16: 
                     17: $half =  imagefilledarc ( $img, 75, 75, 70, 70, 0, 180, $cor, IMG_ARC_PIE );
                     18: $half2 =  imagefilledarc ( $img, 75, 75, 70, 70, 180, 360, $corA, IMG_ARC_PIE );
                     19: 
                     20: ob_start();
                     21: imagepng($img, null, 9);
                     22: $imgsrc = ob_get_contents();
                     23: ob_end_clean();
                     24: 
                     25: var_dump(md5(base64_encode($imgsrc)));
                     26: var_dump($corA);
                     27: ?>
                     28: --EXPECT--
                     29: string(32) "b856a0b1a15efe0f79551ebbb5651fe8"
                     30: int(842163455)

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>