Added some test cases ....
[phpCairo.git] / testcases / phpCairo / clip-empty.php
blob1f56ba7ad393e6c9d2c228ede8a77b1646932bb6
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32, 10, 10);
3 $con = new CairoContext($sur);
4 $con->set_source_rgb(0,0,1);
5 $con->paint();
7 $con->reset_clip();
8 //$con->rectangle(2,2,2,2);
9 $con->clip();
10 //$con->rectangle(6,6,2,2);
11 //$con->clip();
13 $con->translate(0.5,0.5);
15 $con->set_source_rgb(0,1,0);
16 //$con->reset_clip();
17 $con->rectangle(0,0,10,10);
18 //$con->clip();
19 //$con->rectangle(6,6,6,6);
20 //$con->clip();
21 $con->fill_preserve();
22 //$con->rectangle(0,0,10,10);
23 $con->set_source_rgb(1,0,0);
24 //$con->fill();
25 $con->stroke();
26 $con->select_font_face("Bitstream Vera Sans", FONT_SLANT_NORMAL, FONT_WEIGHT_NORMAL);
27 $con->move_to(0,10);
28 $con->show_text("cairo");
29 $sur->write_to_png("clip-empty-php.png");