Annotation of embedaddon/php/ext/gd/tests/imagesetthickness_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Testing imagetruecolortopalette() of GD library
! 3: --CREDITS--
! 4: Rafael Dohms <rdohms [at] gmail [dot] com>
! 5: --SKIPIF--
! 6: <?php
! 7: if (!extension_loaded("gd")) die("skip GD not present");
! 8: if (!function_exists("imagecreatetruecolor")) die("skip GD Version not compatible");
! 9: ?>
! 10: --FILE--
! 11: <?php
! 12: // Create a 200x100 image
! 13: $image = imagecreatetruecolor(200, 100);
! 14: $white = imagecolorallocate($image, 0xFF, 0xFF, 0xFF);
! 15: $black = imagecolorallocate($image, 0x00, 0x00, 0x00);
! 16:
! 17: // Set the background to be white
! 18: imagefilledrectangle($image, 0, 0, 299, 99, $white);
! 19:
! 20: // Set the line thickness to 5
! 21: imagesetthickness($image, 5);
! 22:
! 23: // Draw the rectangle
! 24: imagerectangle($image, 14, 14, 185, 85, $black);
! 25:
! 26: ob_start();
! 27: imagepng($image, null, 9);
! 28: $img = ob_get_contents();
! 29: ob_end_clean();
! 30:
! 31: echo md5(base64_encode($img));
! 32: ?>
! 33: --EXPECT--
! 34: 93c3077f1bdc372cd0b0db96db282985
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>