Added some test cases ....
[phpCairo.git] / testcases / phpCairo / reflected-stroke.php
blob26dc01d11fbc1cd0d48e8773265295cbc75f3932
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->move_to ( 0, -25);
10 $con->curve_to ( 12.5, -12.5, 12.5, -12.5, 0, 0);
11 $con->curve_to ( -12.5, 12.5, -12.5, 12.5, 0, 25);
12 $con->curve_to ( 12.5, 12.5, 12.5, 12.5, 0, 0);
13 $con->stroke ();
15 $con->save ();
16 $con->set_dash ( $dash, 2, 0.);
17 $con->move_to ( 0, 0);
18 $con->arc ( 0, 0, 12.5, 0, 3 * M_PI / 2);
19 $con->close_path ();
20 $con->stroke ();
21 $con->restore ();
23 $sur = new CairoImageSurface(FORMAT_ARGB32,200,200);
24 $con = new CairoContext($sur);
26 $con->set_source_rgb ( 1, 1, 1);
27 $con->paint ();
29 $con->set_source_rgb ( 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->write_to_png("reflected-stroke-php.png");