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);
12 $con2->setSourceRgba(0,1,0,1);
13 $con2->rectangle(10,0,10,10);
15 $con2->setSourceRgba(0,0,1,1);
16 $con2->rectangle(0,10,10,10);
18 $con2->setSourceRgba(1,1,0,1);
19 $con2->rectangle(10,10,10,10);
22 $pat = new CairoSurfacePattern($s);
23 $pat->setExtend(EXTEND_REPEAT
);
24 $con->setSourceRgba(0,0,0,1);
25 $con->rectangle(0,0,100,100);
27 $con->translate(10,10);
28 $con->setOperator(OPERATOR_OVER
);
29 $con->setSource($pat);
30 $con->rectangle(0,0,90,90);
32 $sur->writeToPng("composite-integer-translate-over-repeat-php.png");