ImagickDraw::ellipse

(PECL imagick 2, PECL imagick 3)

ImagickDraw::ellipseDraws an ellipse on the image

说明

public function ImagickDraw::ellipse(
    float $origin_x,
    float $origin_y,
    float $radius_x,
    float $radius_y,
    float $angle_start,
    float $angle_end
): bool
警告

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

Draws an ellipse on the image.

参数

origin_x

origin_y

radius_x

radius_y

angle_start

angle_end

返回值

没有返回值。

示例

示例 #1 ImagickDraw::ellipse() example

<?php
function ellipse($strokeColor, $fillColor, $backgroundColor) {

    $draw = new \ImagickDraw();
    $draw->setStrokeColor($strokeColor);
    $draw->setFillColor($fillColor);

    $draw->setStrokeWidth(2);
    $draw->setFontSize(72);

    $draw->ellipse(125, 70, 100, 50, 0, 360);
    $draw->ellipse(350, 70, 100, 50, 0, 315);

    $draw->push();
    $draw->translate(125, 250);
    $draw->rotate(30);
    $draw->ellipse(0, 0, 100, 50, 0, 360);
    $draw->pop();

    $draw->push();
    $draw->translate(350, 250);
    $draw->rotate(30);
    $draw->ellipse(0, 0, 100, 50, 0, 315);
    $draw->pop();

    $imagick = new \Imagick();
    $imagick->newImage(500, 500, $backgroundColor);
    $imagick->setImageFormat("png");

    $imagick->drawImage($draw);

    header("Content-Type: image/png");
    echo $imagick->getImageBlob();
}

?>