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