svn: /phpdoc/en/trunk/reference/cairo/cairocontext/ fill.xml moveto.xml newpath.xml

From: Date: Wed, 05 May 2010 16:51:02 +0000
Subject: svn: /phpdoc/en/trunk/reference/cairo/cairocontext/ fill.xml moveto.xml newpath.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-6594@lists.php.net to get a copy of this message
markskilbeck Wed, 05 May 2010 16:51:02 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=299026 Log: Adding examples and documentation Changed paths: UU phpdoc/en/trunk/reference/cairo/cairocontext/fill.xml UU phpdoc/en/trunk/reference/cairo/cairocontext/moveto.xml UU phpdoc/en/trunk/reference/cairo/cairocontext/newpath.xml Modified: phpdoc/en/trunk/reference/cairo/cairocontext/fill.xml =================================================================== --- phpdoc/en/trunk/reference/cairo/cairocontext/fill.xml 2010-05-05 16:38:58 UTC (rev 299025) +++ phpdoc/en/trunk/reference/cairo/cairocontext/fill.xml 2010-05-05 16:51:02 UTC (rev 299026) @@ -79,14 +79,42 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ -?> + +$s = new CairoImageSurface(CairoFormat::ARGB32, 100, 100); +$c = new CairoContext($s); + +$c->setSourceRgb(0, 0, 0); +$c->paint(); + +$c->setSourceRgb(1, 1, 1); +$c->rectangle(0, 0, 50, 50); +$c->fill(); +$c->setSourceRgb(0, 1, 0); +$c->rectangle(50, 50, 50, 50); +$c->fill(); + +$s->writeToPng(dirname(__FILE__) . '/CairoContext_fill.png'); ]]> </programlisting> &example.outputs.similar; <screen> <![CDATA[ -... +<?php + +$s = cairo_image_surface_create(CAIRO_SURFACE_TYPE_IMAGE, 100, 100); +$c = cairo_create($s); + +cairo_set_source_rgb($c, 0, 0, 0); +cairo_paint($c); + +cairo_set_source_rgb($c, 1, 1, 1); +cairo_rectangle($c, 0, 0, 50, 50); +cairo_fill($c); +cairo_set_source_rgb($c, 0, 1, 0); +cairo_rectangle($c, 50, 50, 50, 50); +cairo_fill($c); + +cairo_surface_write_to_png($s, dirname(__FILE__) . '/cairo_fill.png'); ]]> </screen> </example> Property changes on: phpdoc/en/trunk/reference/cairo/cairocontext/fill.xml ___________________________________________________________________ Added: svn:eol-style + native Modified: phpdoc/en/trunk/reference/cairo/cairocontext/moveto.xml =================================================================== --- phpdoc/en/trunk/reference/cairo/cairocontext/moveto.xml 2010-05-05 16:38:58 UTC (rev 299025) +++ phpdoc/en/trunk/reference/cairo/cairocontext/moveto.xml 2010-05-05 16:51:02 UTC (rev 299026) @@ -24,10 +24,8 @@ <methodparam><type>string</type><parameter>y</parameter></methodparam> </methodsynopsis> <para> - Description here. + Begin a new sub-path. After this call the current point will be (x, y). </para> - - &warn.undocumented.func; </refsect1> @@ -39,7 +37,7 @@ <term><parameter>context</parameter></term> <listitem> <para> - Description... + A valid CairoContext object. </para> </listitem> </varlistentry> @@ -47,7 +45,7 @@ <term><parameter>x</parameter></term> <listitem> <para> - Description... + The x coordinate of the new position. </para> </listitem> </varlistentry> @@ -55,7 +53,7 @@ <term><parameter>y</parameter></term> <listitem> <para> - Description... + The y coordinate of the new position </para> </listitem> </varlistentry> @@ -66,7 +64,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Description... + &return.void; </para> </refsect1> @@ -78,8 +76,28 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ -?> + +$s = new CairoImageSurface(CairoFormat::ARGB32, 100, 100); +$c = new CairoContext($s); + +$c->setSourceRgb(0, 0, 0); +$c->paint(); + +// Move 10 pixels across, and 10 pixels down +$c->moveTo(10, 10); +$c->lineTo(90, 90); +$c->setLineWidth(2); +$c->setSourceRgb(1, 1, 1); +$c->stroke(); + +// Move 90 pixels across, and 10 pixels down +$c->moveTo(90, 10); +$c->lineTo(10, 90); +$c->setLineWidth(2); +$c->setSourceRgb(1, 1, 1); +$c->stroke(); + +$s->writeToPng(dirname(__FILE__) . '/CairoContext_moveTo.png'); ]]> </programlisting> &example.outputs.similar; @@ -96,8 +114,28 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ -?> + +$s = cairo_image_surface_create(CAIRO_SURFACE_TYPE_IMAGE, 100, 100); +$c = cairo_create($s); + +cairo_set_source_rgb($c, 0, 0, 0); +cairo_paint($c); + +// Move 10 pixels across, and 10 pixels down +cairo_move_to($c, 10, 10); +cairo_line_to($c, 90, 90); +cairo_set_line_width($c, 2); +cairo_set_source_rgb($c, 1, 1, 1); +cairo_stroke($c); + +// Move 90 pixels across, and 10 pixels down +cairo_move_to($c, 90, 10); +cairo_line_to($c, 10, 90); +cairo_set_line_width($c, 2); +cairo_set_source_rgb($c, 1, 1, 1); +cairo_stroke($c); + +cairo_surface_write_to_png($s, dirname(__FILE__) . '/cairo_move_to.png'); ]]> </programlisting> &example.outputs.similar; Property changes on: phpdoc/en/trunk/reference/cairo/cairocontext/moveto.xml ___________________________________________________________________ Added: svn:eol-style + native Modified: phpdoc/en/trunk/reference/cairo/cairocontext/newpath.xml =================================================================== --- phpdoc/en/trunk/reference/cairo/cairocontext/newpath.xml 2010-05-05 16:38:58 UTC (rev 299025) +++ phpdoc/en/trunk/reference/cairo/cairocontext/newpath.xml 2010-05-05 16:51:02 UTC (rev 299026) @@ -21,10 +21,8 @@ <methodparam><type>CairoContext</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> - Description here. + Clears the current path. After this call there will be no path and no current point. </para> - - &warn.undocumented.func; </refsect1> @@ -36,7 +34,7 @@ <term><parameter>context</parameter></term> <listitem> <para> - Description... + A valid CairoContext object. </para> </listitem> </varlistentry> @@ -47,7 +45,7 @@ <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> - Description... + &return.void; </para> </refsect1> @@ -59,16 +57,10 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ -?> +// [...] +CairoContext::newPath(); ]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> + </programlisting> </example> </para> <para> @@ -77,16 +69,10 @@ <programlisting role="php"> <![CDATA[ <?php -/* ... */ -?> +// [...] +cairo_new_path($context); ]]> - </programlisting> - &example.outputs.similar; - <screen> -<![CDATA[ -... -]]> - </screen> + </programlisting> </example> </para> </refsect1> @@ -95,7 +81,8 @@ &reftitle.seealso; <para> <simplelist> - <member><methodname>Classname::Method</methodname></member> + <member><methodname>CairoContext::appendPath</methodname></member> + <member><methodname>CairoContext::closePath</methodname></member> </simplelist> </para> </refsect1> Property changes on: phpdoc/en/trunk/reference/cairo/cairocontext/newpath.xml ___________________________________________________________________ Added: svn:eol-style + native

« previous php.doc.cvs (#6594) next »