PHP GD imagesetbrush() Function


 

PHP GD imagesetbrush() Function

This example shows how to imagesetbrush() Function works in php gd.

This example shows how to imagesetbrush() Function works in php gd.

<?php

$php = imagecreatefromjpeg('im.jpg');

$im = imagecreatetruecolor(100, 100);

$white = imagecolorallocate($im, 255, 255, 255);

imagefilledrectangle($im, 0, 0, 299, 99, $white);

imagesetbrush($im, $php);

imageline($im, 50, 50, 50, 60, IMG_COLOR_BRUSHED);

header('Content-type: image/jpeg');

imagejpeg($im);

imagedestroy($im);

imagedestroy($php);

?>

After running the program you will get the following output

Ads