2 $sur = new CairoImageSurface(FORMAT_ARGB32
, 5, 5);
3 $con = new CairoContext($sur);
11 $s = new CairoImageSurface(FORMAT_ARGB32
, 1, 1);
12 $s->createFromData($color, FORMAT_ARGB32
, 1,1,4);
14 $pat = new CairoSurfacePattern($s);
15 $pat->setExtend(EXTEND_REPEAT
);
17 for($i=0; $i<5; $i++
) {
20 $con->setSourceRgb(.6,.7,.8);
23 $con->setSourceRgba(.2,.4,.6,.5);
26 $con->setSourceRgba(.2,.4,.6,.5);
30 $con->setSource($pat);
33 $con->rectangle($i,0,1,5);
36 $sur->writeToPng("set-source-php.png");