Examples updated to the latest Camel Case .. Was a pain converting them
[phpCairo.git] / testcases / phpCairo / over-between-source.php
blobc298ee32ee0efd3f10d8d63d75b76f1cffdda4ae
1 <?
2 $size = 40;
3 $pad = 2;
4 $width = ($pad + $size + $pad);
5 $height = $width;
6 $sur = new CairoImageSurface(FORMAT_ARGB32,$width,$height);
7 $con = new CairoContext($sur);
9 $con->translate($pad, $pad);
10 $con->moveTo($size/5, $size/5);
11 $con->relLineTo($size/2, 0);
12 $con->relLineTo($size/-2, $size/2);
13 $con->closePath();
15 $con->setOperator(OPERATOR_SOURCE);
16 $con->setSourceRgba(1,0,0,0.5);
18 $con->fill();
20 $con->arc($size/2, $size/2, $size/4, 0, 2*M_PI);
21 $con->setOperator(OPERATOR_OVER);
22 $con->setSourceRgba(0,1,0,0.5);
24 $con->fill();
26 $con->moveTo($size/2, $size/2);
27 $con->relLineTo($size/2, 0);
28 $con->relLineTo($size/-2, $size/2);
29 $con->closePath();
31 $con->setOperator(OPERATOR_SOURCE);
32 $con->setSourceRgba(1,0,0,0.5);
34 $con->fill();
36 $sur->writeToPng("over-between-source-php.png");