CairoContext::clipPreserve

cairo_clip_preserve

(PECL cairo >= 0.1.0)

CairoContext::clipPreserve -- cairo_clip_preserveEstablishes a new clip region from the current clip

说明

面向对象风格 (method):

public CairoContext::clipPreserve ( void ) : void

过程化风格:

cairo_clip_preserve ( CairoContext $context ) : void

Establishes a new clip region by intersecting the current clip region with the current path as it would be filled by Context.fill() and according to the current FILL RULE (see CairoContext::setFillRule() or cairo_set_fill_rule()).

Unlike CairoContext::clip(), CairoContext::clipPreserve() preserves the path within the Context. The current clip region affects all drawing operations by effectively masking out any changes to the surface that are outside the current clip region.

Calling CairoContext::clipPreserve() can only make the clip region smaller, never larger. But the current clip is part of the graphics state, so a temporary restriction of the clip region can be achieved by calling CairoContext::clipPreserve() within a CairoContext::save()/CairoContext::restore() pair. The only other means of increasing the size of the clip region is CairoContext::resetClip().

参数

context

A valid CairoContext object

返回值

没有返回值。

范例

Example #1 面向对象风格

<?php

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

$context = new CairoContext($surface);

$context->clipPreserve();

?>

Example #2 过程化风格

<?php

$surface 
cairo_image_surface_create(CAIRO_FORMAT_ARGB325050);

$context cairo_create($surface);

cairo_clip_preserve($context);

?>

参见

相关文章
php cairocontext establishes a new clip regionphp cairocontext computes the area inside the current clipphp cairocontext establishes a new clip region from the current clipphp cairocontext retrieves the current clip as a list of rectanglesphp cairocontext retrieves the current antialias modephp map creates a new map using values from the current instance and another mapphp set creates a new set using values from the current instance and another setphp ev establishes the current time by querying the kernel updating the time returned by ev now in the progressphp eventbuffer move all data from a buffer provided to the current instance of eventbufferphp eventbuffer moves the specified number of bytes from a source buffer to the end of the current bufferphp db++ 函数 remove tuple and return new current tuplephp imap 函数 mark a message for deletion from current mailboxphp ldap 函数 delete attribute values from current attributesphp newt 函数 replaces the current help line with the one from the stackphp newt 函数 saves the current help line on a stack and displays the new linephp sqlite 函数 fetches the current row from a result set as an arrayphp harupage draw a line from the current point to the specified pointphp hrtime performancecounter current ticks from the systemphp intlrulebasedbreakiterator get the largest status value from the break rules that determined the current break positionphp intlrulebasedbreakiterator get the status values from the break rules that determined the current break position
关注编程学问公众号