1--TEST-- 2Test imagesetbrush() function : basic functionality 3--CREDITS-- 4Erick Belluci Tedeschi <erickbt86 [at] gmail [dot] com> 5#testfest PHPSP on 2009-06-20 6--EXTENSIONS-- 7gd 8--SKIPIF-- 9<?php 10if (!(imagetypes() & IMG_PNG)) { 11 die("skip No PNG support"); 12} 13?> 14--FILE-- 15<?php 16// Create the brush image 17$img = imagecreate(10, 10); 18 19// Create the main image, 100x100 20$mainimg = imagecreatetruecolor(100, 100); 21 22$white = imagecolorallocate($img, 255, 0, 0); 23imagefilledrectangle($img, 0, 0, 299, 99, $white); 24 25// Set the brush 26imagesetbrush($mainimg, $img); 27 28// Draw a couple of brushes, each overlaying each 29imageline($mainimg, 50, 50, 50, 60, IMG_COLOR_BRUSHED); 30 31include_once __DIR__ . '/func.inc'; 32test_image_equals_file(__DIR__ . '/imagesetbrush_basic.png', $mainimg); 33?> 34--EXPECT-- 35The images are equal. 36