如何使用带有多色文本的
PHP GD库为文本添加边框,其中文本颜色与边框颜色不同.
你可以参考:
@H_502_5@@H_502_5@
使用以下功能向文本添加边框
你可以在这里检查示例输出http://wmh.github.io/hunbook/examples/gd-imagettftext.html
function imagettfstroketext(&$image,$size,$angle,$x,$y,&$textcolor,&$strokecolor,$fontfile,$text,$px) { for($c1 = ($x-abs($px)); $c1 <= ($x+abs($px)); $c1++) for($c2 = ($y-abs($px)); $c2 <= ($y+abs($px)); $c2++) $bg = imagettftext($image,$c1,$c2,$strokecolor,$text); return imagettftext($image,$textcolor,$text); }@H_502_5@