imagesetthickness_basic.phpt 800 B

12345678910111213141516171819202122232425262728293031
  1. --TEST--
  2. Testing imagetruecolortopalette() of GD library
  3. --CREDITS--
  4. Rafael Dohms <rdohms [at] gmail [dot] com>
  5. --EXTENSIONS--
  6. gd
  7. --SKIPIF--
  8. <?php
  9. if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
  10. ?>
  11. --FILE--
  12. <?php
  13. // Create a 200x100 image
  14. $image = imagecreatetruecolor(200, 100);
  15. $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
  16. $black = imagecolorallocate($image, 0x00, 0x00, 0x00);
  17. // Set the background to be white
  18. imagefilledrectangle($image, 0, 0, 299, 99, $white);
  19. // Set the line thickness to 5
  20. imagesetthickness($image, 5);
  21. // Draw the rectangle
  22. imagerectangle($image, 14, 14, 185, 85, $black);
  23. include_once __DIR__ . '/func.inc';
  24. test_image_equals_file(__DIR__ . '/imagesetthickness_basic.png', $image);
  25. ?>
  26. --EXPECT--
  27. The images are equal.