ImagickDraw
在线手册:中文 英文
PHP手册

ImagickDraw::bezier

(PECL imagick 2.0.0)

ImagickDraw::bezierDraws a bezier curve

说明

bool ImagickDraw::bezier ( array $coordinates )
Warning

本函数还未编写文档,仅有参数列表。

Draws a bezier curve through a set of points on the image.

参数

coordinates

Multidimensional array like array( array( 'x' => 1, 'y' => 2 ), array( 'x' => 3, 'y' => 4 ) )

返回值

没有返回值。


ImagickDraw
在线手册:中文 英文
PHP手册
PHP手册 - N: Draws a bezier curve

用户评论:

zombiebovine at gmail dot com (14-Sep-2009 11:43)

How to use:

<?php
    $width
200;
   
$height = 200;
   
$border = 2;
   
   
$img = new Imagick();
   
$img->newImage( $width, $height, new ImagickPixel( 'transparent' ) );
   
   
$draw = new ImagickDraw();
   
$draw->setStrokeColor( new ImagickPixel( 'black' ) );
   
$draw->setStrokeWidth( 2 );
   
$draw->setFillColor( new ImagickPixel( 'transparent' ) );

   
// will fail in an obscure manner if the input data is invalid
   
$points = array
    (
        array(
'x' => 0, 'y' => 200 ),
        array(
'x' => 0, 'y' => 0 ),
        array(
'x' => 200, 'y' => 200 ),
        array(
'x' => 200, 'y' => 0 )
    );
   
   
$draw->bezier($points);
           
   
$img->drawImage( $draw );
   
$img->setImageFormat( "png" );
   
   
header( "Content-Type: image/png" );
    echo
$img;
?>