Examples updated to the latest Camel Case .. Was a pain converting them
[phpCairo.git] / testcases / phpCairo / fill-rule.php
blobb7722db66a5af6d9bdf23f590c88087900f82ab8
1 <?
2 function little_star_path()
4 global $con;
5 $con->moveTo(10,0);
6 $con->relLineTo(6,20);
7 $con->relLineTo(-16,-12);
8 $con->relLineTo(20,0);
9 $con->relLineTo(-16,12);
12 function big_star_path()
14 global $con;
15 $con->moveTo(40,0);
16 $con->relLineTo(25,80);
17 $con->relLineTo(-65,-50);
18 $con->relLineTo(80,0);
19 $con->relLineTo(-65,50);
20 $con->closePath();
23 $sur = new CairoImageSurface(FORMAT_ARGB32, 163, 103);
24 $con = new CairoContext($sur);
25 $con->setSourceRgb(1,0,0);
26 $con->translate(1,1);
27 little_star_path();
28 $con->setFillRule(FILL_RULE_WINDING);
29 $con->fill();
30 $con->translate(21,0);
31 little_star_path();
32 $con->setFillRule(FILL_RULE_EVEN_ODD);
33 $con->fill();
34 $con->translate(-21, 21);
35 big_star_path();
36 $con->setFillRule(FILL_RULE_WINDING);
37 $con->fill();
38 $con->translate(81,0);
39 big_star_path();
40 $con->setFillRule(FILL_RULE_EVEN_ODD);
41 $con->fill();
42 $sur->writeToPng("fill-rule-php.png");