Examples updated to the latest Camel Case .. Was a pain converting them
[phpCairo.git] / testcases / phpCairo / reflected-stroke.php
blob8d8546f5d810217bb35c7345d886b7ae54cb32b5
1 <?
2 function draw_symbol ()
4 $dash = array(6.0, 3.0);
5 global $con;
6 $con->rectangle ( -25, -25, 50, 50);
7 $con->stroke ();
9 $con->moveTo ( 0, -25);
10 $con->curveTo ( 12.5, -12.5, 12.5, -12.5, 0, 0);
11 $con->curveTo ( -12.5, 12.5, -12.5, 12.5, 0, 25);
12 $con->curveTo ( 12.5, 12.5, 12.5, 12.5, 0, 0);
13 $con->stroke ();
15 $con->save ();
16 $con->setDash ( $dash, 2, 0.);
17 $con->moveTo ( 0, 0);
18 $con->arc ( 0, 0, 12.5, 0, 3 * M_PI / 2);
19 $con->closePath ();
20 $con->stroke ();
21 $con->restore ();
23 $sur = new CairoImageSurface(FORMAT_ARGB32,200,200);
24 $con = new CairoContext($sur);
26 $con->setSourceRgb ( 1, 1, 1);
27 $con->paint ();
29 $con->setSourceRgb ( 0, 0, 0);
31 $con->save ();
32 $con->translate ( 50, 50);
33 $con->scale ( 1, 1);
34 draw_symbol ();
35 $con->restore ();
37 $con->save ();
38 $con->translate ( 150, 50);
39 $con->scale ( -1, 1);
40 draw_symbol ();
41 $con->restore ();
43 $con->save ();
44 $con->translate ( 150, 150);
45 $con->scale ( -1, -1);
46 draw_symbol ();
47 $con->restore ();
49 $con->save ();
50 $con->translate ( 50, 150);
51 $con->scale ( 1, -1);
52 draw_symbol ();
53 $con->restore ();
54 $sur->writeToPng("reflected-stroke-php.png");