Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 22 lines (18 sloc) 0.524 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
<?php
$sur = new CairoImageSurface(CairoFormat::ARGB32, 10, 10);
$con = new CairoContext($sur);
$con->setSourceRgb(0,0,1);
$con->paint();

$con->resetClip();
$con->clip();

$con->translate(0.5,0.5);

$con->setSourceRgb(0,1,0);
$con->rectangle(0,0,10,10);
$con->fillPreserve();
$con->setSourceRgb(1,0,0);
$con->stroke();
$con->selectFontFace("Bitstream Vera Sans", CairoFontSlant::NORMAL, CairoFontWeight::NORMAL);
$con->moveTo(0,10);
$con->showText("cairo");
$sur->writeToPng(dirname(__FILE__) . "/clip-empty-php.png");
?>
Something went wrong with that request. Please try again.