Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / sphere.php
blob43bd4a1ea05030183830251017c970a625c23d7e
1 <?
2 $Surface = new CairoImageSurface(0,256,256);
3 $ctx = new CairoContext($Surface);
4 $ctx->setAntialias(0);
5 $ctx->setFillRule(0);
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);
13 //$ctx->stroke();
14 $ctx->fill();
16 $pat = new CairoRadialGradient(0.45, 0.4, 0.1,
17 0.4, 0.4, 0.5);
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);
22 //$ctx->fill();
24 //$ctx->stroke();
25 $ctx->fill();
26 $Surface->writeToPng("image.png");