<?php
bool imagesetbrush ( GdImage $image, GdImage $brush )
where,
$image = The image identifier
$brush = The image identifier to be used as a brush
?>
IMAGE COLOR STYLE OPTIONS | ||
CONSTANT | VALUE | MEANING |
IMG_COLOR_STYLED | -2 | The stroke will have style |
IMG_COLOR_BRUSHED | -3 | The stroke will be brushed |
IMG_COLOR_STYLEDBRUSHED | -4 | The stroke will have brushed style |
IMG_COLOR_TILED | -5 | The stroke will be decorated, (tiled) |
IMG_COLOR_TRANSPARENT | -6 | The stroke will have transparent regions |
ed48 |
<?php
echo 'PHP VERSION: ' . PHP_VERSION . '<br><br>';
$obase_img = "png/baseXx.png";
$brush_img = "png/PNG 073 01.png";
$dbase_img = "png/PNG 073 01 imagesetbrush.png";
$id_obase = imagecreatefrompng($obase_img);
$white = imagecolorallocate($id_obase, 255, 255, 255);
$yellow = imagecolorallocate($id_obase, 255, 255, 0);
$arr_st_white = array($white, $white);
echo basename($brush_img); ?><br><br>
<img src="<?php echo $brush_img; ?>"
alt="<?php echo $brush_img; ?>"
title="<?php echo $brush_img; ?>">
<br><br>
<?php echo basename($obase_img); ?><br><br>
<img src="<?php echo $obase_img; ?>"
alt="<?php echo $obase_img; ?>"
title="<?php echo $obase_img; ?>">
<br><br><br>
<?php
$id_brush = imagecreatefrompng($brush_img);
imagefill($id_brush, 0, 0, $yellow);
imagesetbrush($id_obase, $id_brush);
imagesetstyle($id_obase, $arr_st_white);
$x0 = 50;
$y0 = 50;
$xN = 250;
$yN = 250;
imageline($id_obase, $x0, $y0,
$xN, $yN,
IMG_COLOR_STYLEDBRUSHED);
imagepng($id_obase, $dbase_img);
echo basename($dbase_img); ?><br><br>
<img src="<?php echo $dbase_img; ?>"
alt="<?php echo $dbase_img; ?>"
title="<?php echo $dbase_img; ?>">