PHP Doku:: Fills the current path - cairocontext.fill.html

Verlauf / Chronik / History: (3) anzeigen

Sie sind hier:
Doku-Startseite ≥ PHP-Handbuch ≥ Funktionsreferenz ≥ Bildverarbeitung und -generierung ≥ Cairo ≥ The CairoContext class ≥ CairoContext::fill -- cairo_fill

Ein Service von Reinhard Neidl - Webprogrammierung.

The CairoContext class

<<CairoContext::deviceToUserDistance -- cairo_device_to_user_distance

CairoContext::fillExtents -- cairo_fill_extents>>

CairoContext::fill

cairo_fill

(PECL cairo >= 0.1.0)

CairoContext::fill -- cairo_fill — Fills the current path

Beschreibung

Object oriented style (method):

public void CairoContext::fill ( void )

Procedural style:

void cairo_fill ( CairoContext $context )

A drawing operator that fills the current path according to the current CairoFillRule, (each sub-path is implicitly closed before being filled). After CairoContext::fill() or cairo_fill(), the current path will be cleared from the CairoContext.

Parameter-Liste

context

A valid CairoContext object created with CairoContext::__construct() or cairo_create()

Rückgabewerte

Es wird kein Wert zurückgegeben.

Beispiele

Beispiel #1 Object oriented style

<?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');

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

...

Beispiel #2 Procedural style

<?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');

?>

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

...

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)