Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$title is deprecated in /home/www/dev/work/website/lvesu/class/controller/blog/php.php on line 28

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/php.manual.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\php::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
PHP - Manual: ImagickDraw::pushClipPath - 互联网笔记

略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: ImagickDraw::pushClipPath

2025-05-10

ImagickDraw::pushClipPath

(PECL imagick 2, PECL imagick 3)

ImagickDraw::pushClipPathStarts a clip path definition

说明

public ImagickDraw::pushClipPath(string $clip_mask_id): bool
警告

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

Starts a clip path definition which is comprised of any number of drawing commands and terminated by a ImagickDraw::popClipPath() command.

参数

clip_mask_id

Clip mask Id

返回值

没有返回值。

添加备注

用户贡献的备注 1 note

up
0
bogdan at moongate dot ro
13 years ago
Here's an interactive example for your enjoyment, featuring two intersecting discs. My version doesn't antialias the clipping path; I suppose YMMV.

<?php

// Simple clip path example
// Bogdan Stancescu

$showClipping=1; // Try setting this to 0!
$showDrawing=1; // Try setting this to 0!

// Don't edit below this line (at least until you understand the example)

$showBoth=$showClipping && $showDrawing;
$showAny=$showClipping || $showDrawing;

$image=new Imagick(); // Create image

// Image size
$width=151;
$height=101;

$image->newImage($width, $height, new ImagickPixel('lightgray')); // some visible background

$draw=new ImagickDraw(); // Create draw object

if ($showBoth)
$draw->pushClipPath('circle_left'); // Start clipping path

if ($showClipping) {
$draw->setFillColor('red'); // The color doesn't matter if we clip
$draw->circle(50,50,50,0); // A circle that occupies 100x100px on the left
}

if (
$showBoth) {
$draw->popClipPath(); // Finish clipping path
$draw->setClipPath('circle_left'); // Use the clipping path above
}

if (
$showDrawing) {
$draw->setFillColor('navy'); // This is the actual drawing color
$draw->circle(100,50,100,0); // A circle that occupies 100x100px on the right
}

if (
$showAny)
$image->drawImage($draw); // Render $draw unto $image

$image->setImageFormat('png'); // Tell ImageMagick how to render this
header("Content-Type: image/png"); // Tell the browser how to render this

echo $image; // Render the image into the browser
?>

官方地址:https://www.php.net/manual/en/imagickdraw.pushclippath.php

冷却塔厂家 广告
中文GPT4.0无需注册 广告
北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3