1--TEST-- 2imagesetclip() - basic functionality 3--SKIPIF-- 4<?php 5if (!extension_loaded('gd')) die('skip ext/gd required'); 6?> 7--FILE-- 8<?php 9// draw a clipped diagonal line 10$im = imagecreate(100, 100); 11imagecolorallocate($im, 0, 0, 0); 12$white = imagecolorallocate($im, 255, 255, 255); 13imagesetclip($im, 10,10, 89,89); 14imageline($im, 0,0, 99,99, $white); 15 16// save image for manual inspection 17// imagepng($im, __FILE__ . '.png'); 18 19// verify that the clipping has been respected 20imagesetclip($im, 0,0, 99,99); 21var_dump(imagecolorat($im, 9,9) !== $white); 22var_dump(imagecolorat($im, 90,90) !== $white); 23?> 24--EXPECT-- 25bool(true) 26bool(true) 27