Added some test cases ....
[phpCairo.git] / testcases / phpCairo / dash-curve.php
blob8524324490a8b89112afb41dfac5218054e337d8
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32, 25*60, 4*60);
3 $con = new CairoContext($sur);
4 //$con->save();
5 $dash = array(20.0,20.0);
7 $con->set_source_rgb(0, 0, 0);
8 $con->paint();
10 for($a=0; $a<4; $a++)
11 for($b=0; $b<5; $b++)
12 for($c=0; $c<5; $c++) {
14 $con->move_to((($b*5)+$c)*60 + 10, $a*60 + 10);
15 $con->rel_curve_to(0, $b*10, 0, $b*10, $c*10, $b*10);
16 $con->set_source_rgb(1,1,1);
17 $con->set_line_width(8);
18 $con->set_line_cap(LINE_CAP_ROUND);
19 $con->set_dash($dash, 2, $a*10);
20 $con->stroke_preserve();
21 $con->set_source_rgb(0,0.5,1);
22 //$con->restore();
23 //$con->set_source_rgb(1,1,1);
24 $con->set_line_width(2);
25 $con->set_line_cap(2);
26 $ar = array(8.0,8.0);
27 $con->set_dash($ar,2,0);
28 $con->stroke();
31 $sur->write_to_png("dash-curve-php.png");