Examples updated to the latest Camel Case .. Was a pain converting them
[phpCairo.git] / testcases / phpCairo / composite-integer-translate-over-repeat.php
blobadaad8a5cf4212bf6b959e7104293a2c29afc068
2 <?
3 $sur = new CairoImageSurface(FORMAT_ARGB32,100, 100);
4 $con = new CairoContext($sur);
6 $s = new CairoImageSurface(FORMAT_ARGB32,20, 20);
7 $con2 = new CairoContext($s);
9 $con2->setSourceRgba(1,0,0,1);
10 $con2->rectangle(0,0,10,10);
11 $con2->fill();
12 $con2->setSourceRgba(0,1,0,1);
13 $con2->rectangle(10,0,10,10);
14 $con2->fill();
15 $con2->setSourceRgba(0,0,1,1);
16 $con2->rectangle(0,10,10,10);
17 $con2->fill();
18 $con2->setSourceRgba(1,1,0,1);
19 $con2->rectangle(10,10,10,10);
20 $con2->fill();
22 $pat = new CairoSurfacePattern($s);
23 $pat->setExtend(EXTEND_REPEAT);
24 $con->setSourceRgba(0,0,0,1);
25 $con->rectangle(0,0,100,100);
26 $con->fill();
27 $con->translate(10,10);
28 $con->setOperator(OPERATOR_OVER);
29 $con->setSource($pat);
30 $con->rectangle(0,0,90,90);
31 $con->fill();
32 $sur->writeToPng("composite-integer-translate-over-repeat-php.png");