imagecopymergegray_basic.phpt 645 B

1234567891011121314151617181920212223242526272829
  1. --TEST--
  2. Testing imagecopymergegray() of GD library
  3. --CREDITS--
  4. Sean Fraser <frasmage [at] gmail [dot] com>
  5. PHP[tek] 2017
  6. --EXTENSIONS--
  7. gd
  8. --FILE--
  9. <?php
  10. $des = imagecreate(120, 120);
  11. $src = imagecreate(100, 100);
  12. $color_des = imagecolorallocate($des, 50, 50, 200);
  13. $color_src = imagecolorallocate($src, 255, 255, 0);
  14. imagefill($des, 0, 0, $color_des);
  15. imagefill($src, 0, 0, $color_src);
  16. var_dump(imagecopymergegray($des, $src, 20, 20, 0, 0, 50, 50, 75));
  17. $color = imagecolorat($des, 30, 30);
  18. $rgb = imagecolorsforindex($des, $color);
  19. echo $rgb['red'], ", ", $rgb['green'], ", ", $rgb['blue'], "\n";
  20. ?>
  21. --EXPECT--
  22. bool(true)
  23. 208, 208, 16