使用畫筆建立粗線條。
建立一個 3x3 的紅色畫筆
<?php
$brush_size = 3;
$brush = imagecreatetruecolor($brush_size,$brush_size);
$brush_color = imagecolorallocate($brush,255,0,0);
imagefill($brush,0,0,$brush_color);
imagesetbrush($im,$brush);
?>
然後使用 `imageline()` 或 `imagepolygon()`,並以 `IMG_COLOR_BRUSHED` 作為顏色。
要停止使用畫筆,請將其銷毀
<?php imagedestroy($brush); ?>
畫筆也可以從現有圖像建立。