PHP 8.3.4 Released!

ps_lineto

(PECL ps >= 1.1.0)

ps_lineto直線を描く

説明

ps_lineto(resource $psdoc, float $x, float $y): bool

現在の位置から指定された座標までの直線を現在のパスに追加します。 直線の開始位置を指定するには ps_moveto() を利用します。

パラメータ

psdoc

ps_new() が返す、postscript ファイルのリソース ID。

x

直線の終了地点の x 座標。

y

直線の終了地点の y 座標。

戻り値

成功した場合に true を、失敗した場合に false を返します。

例1 矩形を描画する

<?php
$ps
= ps_new();
if (!
ps_open_file($ps, "rectangle.ps")) {
print
"PostScript ファイルをオープンできません\n";
exit;
}

ps_set_info($ps, "Creator", "rectangle.php");
ps_set_info($ps, "Author", "Uwe Steinmann");
ps_set_info($ps, "Title", "Lineto example");

ps_begin_page($ps, 596, 842);
ps_moveto($ps, 100, 100);
ps_lineto($ps, 100, 200);
ps_lineto($ps, 200, 200);
ps_lineto($ps, 200, 100);
ps_lineto($ps, 100, 100);
ps_stroke($ps);
ps_end_page($ps);

ps_delete($ps);
?>

参考

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top