略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: CairoContext::copyPathFlat

2024-04-20

CairoContext::copyPathFlat

cairo_copy_path_flat

(PECL cairo >= 0.1.0)

CairoContext::copyPathFlat -- cairo_copy_path_flatGets a flattened copy of the current path

说明

面向对象风格 (method):

public CairoContext::copyPathFlat ( void ) : CairoPath

过程化风格:

cairo_copy_path_flat ( CairoContext $context ) : CairoPath

Gets a flattened copy of the current path and returns it to the user as a CairoPath.

This function is like CairoContext::copyPath() except that any curves in the path will be approximated with piecewise-linear approximations, (accurate to within the current tolerance value). That is, the result is guaranteed to not have any elements of type CAIRO_PATH_CURVE_TO which will instead be replaced by a series of CAIRO_PATH_LINE_TO elements.

参数

context

A CairoContext object

返回值

A copy of the current path

范例

Example #1 面向对象风格

<?php

$surface 
= new CairoImageSurface(CairoFormat::ARGB325050);

$context = new CairoContext($surface);

var_dump($context->copyPathFlat());

?>

以上例程的输出类似于:

object(CairoPath)#3 (0) {
}

Example #2 过程化风格

<?php

$surface 
cairo_image_surface_create(CAIRO_FORMAT_ARGB325050);

$context cairo_create($surface);

var_dump(cairo_copy_path_flat($context));

?>

以上例程的输出类似于:

object(CairoPath)#3 (0) {
}

参见

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/cairocontext.copypathflat.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3