2 $Surface = new CairoImageSurface(0,256,256);
3 $ctx = new CairoContext($Surface);
6 $ctx->scale(256/1.0, 256/1.0);
8 $pat = new CairoLinearGradient(0.0, 0.0, 0.0, 1.0);
9 $pat->addColorStopRgba(1, 0, 0, 0, 1);
10 $pat->addColorStopRgba(0, 1, 1, 1, 1);
11 $ctx->rectangle(0,0,1,1);
12 $ctx->setSource($pat);
16 $pat = new CairoRadialGradient(0.45, 0.4, 0.1,
18 $pat->addColorStopRgba(0, 1, 1, 1, 1);
19 $pat->addColorStopRgba(1, 0, 0, 0, 1);
20 $ctx->setSource($pat);
21 $ctx->arc(.5, .5, .3, 0, 2*3.14);
26 $Surface->writeToPng("image.png");