Annotation of embedaddon/php/ext/gd/tests/imagefilltoborder_basic.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Testing imagefilltoborder() of GD library
3: --CREDITS--
4: Ivan Rosolen <contato [at] ivanrosolen [dot] com>
5: #testfest PHPSP on 2009-06-30
6: --SKIPIF--
7: <?php
8: if (!extension_loaded("gd")) die("skip GD not present");
9: ?>
10: --FILE--
11: <?php
12: // Create a image
13: $image = imagecreatetruecolor( 100, 100 );
14:
15: // Draw a rectangle
16: imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
17:
18: // Draw an ellipse to fill with a black border
19: imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
20:
21: // Fill border
22: imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
23:
24: ob_start();
25: imagepng( $image, null, 9 );
26: $img = ob_get_contents();
27: ob_end_clean();
28:
29: echo md5(base64_encode($img));
30:
31: ?>
32: --EXPECT--
33: 847ec236f1c4d14c465306c8408550fc
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>