2 $sur = new CairoImageSurface(FORMAT_ARGB32
, 12, 12);
3 $con = new CairoContext($sur);
4 $source = $sur->createSimilar (
8 $con2 = new CairoContext($source);
10 /* Fill the source surface with green */
12 $con2->setSourceRgb ( 0, 1, 0);
15 /* Draw a blue square in the middle of the source with clipping,
16 * and leave the clip there. */
21 $con2->setSourceRgb ( 0, 0, 1);
24 /* Fill the destination surface with solid red (should not appear
26 $con->setSourceRgb ( 1, 0, 0);
29 /* Now draw the source surface onto the destination surface */
30 $con->setSourceSurface ( $source, 0, 0);
32 $sur->writeToPng("source-clip-php.png");