<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="generator" content= "HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org" /> <title>RMagick 0.0.0: RVG Reference: RVG::ClipPath Class</title> <meta http-equiv="Content-Type" content= "text/html; charset=us-ascii" /> <meta name="GENERATOR" content="Quanta Plus" /> <meta name="Copyright" content= "Copyright (C) 2006 by Timothy P. Hunter" /> <link rel="stylesheet" type="text/css" href="css/doc.css" /> <script type="text/javascript" src="scripts/doc.js"> </script> <script type="text/javascript"> //<![CDATA[ //]]> </script> <style type="text/css"> /*<![CDATA[*/ } /*]]>*/ </style> </head> <body> <h6 id="header">RMagick 0.0.0 User's Guide and Reference</h6> <div class="nav"> « <a href="rvgpattern.html">Prev</a> | <a href= "index.html">Contents</a> | <a href= "rvgtext.html">Next</a> » </div> <h1>class RVG::ClipPath <span class="superclass">< Object</span></h1> <div id="toc"> <h2>Table of Contents</h2> <h3>class methods</h3> <ul> <li><a href="#new">new</a></li> </ul> <h3>attributes</h3> <div class="toccol"> <ul> <li><a href="#desc">desc, desc=</a></li> <li><a href="#metadata">metadata, metadata=</a></li> <li><a href="#title">title, title=</a></li> </ul> </div> <h3>instance methods</h3> <div class="toccol"> <ul> <li><a href="#text">text</a></li> <li><a href="#use">use</a></li> </ul> </div> <h3>shared methods</h3> <p>In addition to the methods listed above, <code>class RVG::ClipPath</code> also implements the <a href= "rvgstyle.html">styles</a> method and the <a href= "rvgshape.html">shape methods</a>.</p> </div> <h2 class="methods">class methods</h2> <div class="sig"> <h3 id="new">new</h3> <p>RVG::ClipPath.new(<span class="arg">clip_path_units</span>) [ <span class="arg">{ |clippath| drawing method calls }</span> ] -> <em>clippath</em></p> </div> <div class="desc"> <h4>Description</h4> <p>Creates a <em>clipping path</em>. A clipping path is a combination of path, text, and basic shape objects that define an outline. Attach the clipping path to an object such as a raster image or RVG object with the :clip_path style. When RVG draws the object, things "outside" the path are not drawn.</p> <p>The ClipPath.new method yields to a block. Within the block define the clipping path with a combination of path, basic shape, and <a href="#text">text</a> objects. You can also use the <a href="#use">use</a> method to refer to a previously-defined object or group of objects.</p> <h4>Arguments</h4> <dl> <dt>clip_path_units</dt> <dd>Defines the coordinate system for the contents of the clipping path. This argument can take either of two values, <strong>userSpaceOnUse</strong>, or <strong>objectBoundingBox</strong>. If <code>userSpaceOnUse</code>, the contents of the clipping path represent values in the current user coordinate system in place at the time when the clipping path is referenced. if objectBoundingBox, then the user coordinate system for the contents of the clipping path is established using the bounding box of the object to which the clipping path is applied. The default is <code>userSpaceOnUse</code>.</dd> </dl> <h4>Example</h4> <p><a href="javascript:popup('rvg_clippath.rb.html')"><img src= "ex/rvg_clippath.gif" title="Click to see the example script" alt="clipping path example" /></a></p> <h4>See Also</h4> <p>The <a href="rvgstyle.html">:clip_rule</a> style.</p> </div> <h2 class="methods">attributes</h2> <div class="sig"> <h3 id="desc">desc, desc=</h3> <p><span class="arg">clippath</span>.desc -> <em>string</em><br /> <span class="arg">clippath</span>.desc = <span class= "arg">string</span></p> </div> <div class="desc"> <h4>Description</h4>Use the <code>desc</code> attribute to assign a text description to the clipping path. </div> <div class="sig"> <h3 id="metadata">metadata, metadata=</h3> <p><span class="arg">clippath</span>.metadata -> <em>string</em><br /> <span class="arg">clippath</span>.metadata = <span class= "arg">string</span></p> </div> <div class="desc"> <h4>Description</h4>Use the <code>metadata</code> attribute to assign additional metadata to the clipping path. </div> <div class="sig"> <h3 id="title">title, title=</h3> <p><span class="arg">clippath</span>.title -> <em>string</em><br /> <span class="arg">clippath</span>.title = <span class= "arg">string</span></p> </div> <div class="desc"> <h4>Description</h4>Use the <code>title</code> attribute to assign a title to the clipping path. </div> <h2 class="methods">instance methods</h2> <div class="sig"> <h3 id='text'>text</h3> <p><span class="arg">clippath.</span>text(<span class= "arg">x</span>=0, <span class="arg">y</span>=0, <span class= "arg">text</span>=nil) [{|<span class="arg">text</span>| ...}] -> <em>text</em></p> </div> <div class="desc"> <h4>Description</h4> <p>Calls <a href="rvgtext.html#new">RVG::Text.new</a> to construct a text object and adds it to the clipping path. Yields to a block if one is present, passing the new text object as an argument.</p> <h4>Returns</h4> <p>The <code>RVG::Text</code> object, so other <code>RVG::Text</code> methods can be chained to this method.</p> </div> <div class="sig"> <h3 id="use">use</h3> <p><span class="arg">clippath.</span>use(<span class= "arg">obj</span>, <span class="arg">x</span>=0, <span class= "arg">y</span>=0, <span class="arg">width</span>=nil, <span class="arg">height</span>=nil) -> <em>use</em></p> </div> <div class="desc"> <h4>Description</h4> <p>Calls <a href="rvguse.html#new">RVG::Use.new</a> to constructs a <code>use</code> object and adds it to the clipping path.</p> <p>When the referenced argument is another RVG object, <span class="arg">width</span> and <span class= "arg">height</span> can be used to specify the width and height of the viewport. If present and non-nil, these arguments override any width and height specified when the RVG object was created. You must specify the viewport size either when creating the RVG object or when referencing it with <code>use</code>.</p> <h4>Examples</h4> <p>See <a href="rvguse.html#new">RVG::Use.new</a></p> <h4>Returns</h4> <p>The <code>RVG::Use</code> object, so other <code>RVG::Use</code> methods can be chained to this method.</p> </div> <p class="spacer"> </p> <div class="nav"> « <a href="rvgpattern.html">Prev</a> | <a href= "index.html">Contents</a> | <a href= "rvgtext.html">Next</a> » </div> </body> </html>