文字

HaruPage::lineTo

(PECL haru >= 0.0.1)

HaruPage::lineToDraw a line from the current point to the specified point

说明

bool HaruPage::lineTo ( float $x , float $y )

Draws a line from the current point to the specified point.

参数

x

y

返回值

Returns TRUE on success.

错误/异常

发生错误时抛出 HaruException 异常。

参见

  • HaruPage::curveTo() - Append a Bezier curve to the current path
  • HaruPage::curveTo2() - Append a Bezier curve to the current path
  • HaruPage::curveTo3() - Append a Bezier curve to the current path

用户评论:

[#1] aku at syuaa dot net [2011-06-08 23:38:53]

Here i show a simple example for this Line to.

<?php 
$doc
=new HaruDoc;

$page=$doc->addPage();
$page->setSize(HaruPage::SIZE_A4HaruPage::PORTRAIT);

$page->setRGBStroke(0,0,0); // Set color to black
$page->setRGBFill(1,1,1); // Set fill to 100% for each rgb color
$page->moveTo(60100); // Move cursor to x 60, y 100
$page->lineTo(60,500); // Create line from x 60, y100 to x60, y500
$page->fillStroke();

//Output
header('Content-Type: application/pdf');
$doc->output();
?>

上一篇: 下一篇: