(PECL ps >= 1.1.0)
ps_setpolydash — 设置虚线的显示方式
设置虚线的黑色和白色部分的长度。 ps_setpolydash() 用于设置更复杂的虚线模式。
范例 #1 绘制一条虚线
<?php
$ps = ps_new();
if (!ps_open_file($ps, "polydash.ps")) {
print "无法打开 PostScript 文件\n";
exit;
}
ps_set_info($ps, "Creator", "polydash.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Poly dash example");
ps_begin_page($ps, 596, 842);
ps_setpolydash($ps, array(10, 5, 2, 5));
ps_moveto($ps, 100, 100);
ps_lineto($ps, 200, 200);
ps_stroke($ps);
ps_end_page($ps);
ps_delete($ps);
?>
此示例绘制一条线,其长度分别为 10 个点和 2 个点,中间间隔为 5 个点。