PHP Velho Oeste 2024

SWFShape::drawCurveTo

(PHP 5 < 5.3.0, PECL ming SVN)

SWFShape::drawCurveTo曲線を描く

説明

SWFShape::drawCurveTo ( float $controlx , float $controly , float $anchorx , float $anchory [, float $targetx ], float $targety ) : int
警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

swfshape::drawcurveto() は、 (swfshape::setline() で設定した現在の線スタイルを 使用して) 現在のペンの位置から (anchorx,anchory) まで 制御点 (controlx,controly) を使用して 2 次曲線を描きます。つまり、制御点にまず向かった後で、 anchor 点までなめらかに戻ってくるということです。

6 つのパラメータを使用すると、点 (targetx, targety) に向かって 制御点 (controlx, controly) および (anchorx, anchory). を使用して 3 次ベジエ曲線を描きます。

参考

  • SWFShape::drawCurveTo()

add a note add a note

User Contributed Notes 1 note

up
0
Chris
18 years ago
for those new this all this, "anchor" is where you want to end up and "control" is the point you would go to if you were drawing a square.

for example, this would draw a quarter circle
<?php
    $s
->movePenTo(100, 100);
   
$s->drawLineTo(200, 100);
   
$s->drawCurveTo(200, 200, 100, 200);
   
$s->drawLineTo(100, 100);
?>
To Top