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--SKIPIF-- 7<?php 8if (!extension_loaded('gd')) { 9 die('skip gd extension is not loaded'); 10} 11?> 12--FILE-- 13<?php 14// Create the brush image 15$img = imagecreate(10, 10); 16 17// Create the main image, 100x100 18$mainimg = imagecreatetruecolor(100, 100); 19 20$white = imagecolorallocate($img, 255, 0, 0); 21imagefilledrectangle($img, 0, 0, 299, 99, $white); 22 23// Set the brush 24imagesetbrush($mainimg, $img); 25 26// Draw a couple of brushes, each overlaying each 27imageline($mainimg, 50, 50, 50, 60, IMG_COLOR_BRUSHED); 28 29// Get output and generate md5 hash 30ob_start(); 31imagepng($mainimg, null, 9); 32$result_image = ob_get_contents(); 33ob_end_clean(); 34echo md5(base64_encode($result_image)); 35?> 36--EXPECT-- 378168577c0d1fe6d9d11397cb15263d82 38