imagesetbrush_basic.phpt 723 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Test imagesetbrush() function : basic functionality
  3. --CREDITS--
  4. Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com>
  5. #testfest PHPSP on 2009-06-20
  6. --EXTENSIONS--
  7. gd
  8. --FILE--
  9. <?php
  10. // Create the brush image
  11. $img = imagecreate(10, 10);
  12. // Create the main image, 100x100
  13. $mainimg = imagecreatetruecolor(100, 100);
  14. $white = imagecolorallocate($img, 255, 0, 0);
  15. imagefilledrectangle($img, 0, 0, 299, 99, $white);
  16. // Set the brush
  17. imagesetbrush($mainimg, $img);
  18. // Draw a couple of brushes, each overlaying each
  19. imageline($mainimg, 50, 50, 50, 60, IMG_COLOR_BRUSHED);
  20. include_once __DIR__ . '/func.inc';
  21. test_image_equals_file(__DIR__ . '/imagesetbrush_basic.png', $mainimg);
  22. ?>
  23. --EXPECT--
  24. The images are equal.