imagefilltoborder_basic.phpt 759 B

123456789101112131415161718192021222324252627
  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. --EXTENSIONS--
  7. gd
  8. --FILE--
  9. <?php
  10. // Create a image
  11. $image = imagecreatetruecolor( 100, 100 );
  12. // Draw a rectangle
  13. imagefilledrectangle( $image, 0, 0, 100, 100, imagecolorallocate( $image, 255, 255, 255 ) );
  14. // Draw an ellipse to fill with a black border
  15. imageellipse( $image, 50, 50, 50, 50, imagecolorallocate( $image, 0, 0, 0 ) );
  16. // Fill border
  17. imagefilltoborder( $image, 50, 50, imagecolorallocate( $image, 0, 0, 0 ), imagecolorallocate( $image, 255, 0, 0 ) );
  18. include_once __DIR__ . '/func.inc';
  19. test_image_equals_file(__DIR__ . '/imagefilltoborder_basic.png', $image);
  20. ?>
  21. --EXPECT--
  22. The images are equal.