Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / long-lines.php
blob1954af613d5df02ae1e9827aa678e5c0acd25067
1 <?
2 $width = 10;
3 $height = 8;
4 $sur = new CairoImageSurface(FORMAT_ARGB32, 70, 70);
5 $con = new CairoContext($sur);
7 $line[0] = array("len"=>100.0, "r"=>1, "g"=>0, "b"=>0);
8 $line[1] = array("len"=>10000.0, "r"=>0, "g"=>1, "b"=>0);
9 $line[2] = array("len"=>10000.0, "r"=>0, "g"=>0, "b"=>1);
10 $line[3] = array("len"=>10000.0, "r"=>1, "g"=>1, "b"=>0);
11 $line[4] = array("len"=>10000.0, "r"=>0, "g"=>1, "b"=>1);
12 $line[5] = array("len"=>10000.0, "r"=>1, "g"=>0, "b"=>1);
14 $con->save();
15 $con->setSourceRgb(1,1,1);
16 $con->paint();
17 $con->restore();
18 $con->save();
19 $con->setLineWidth(1);
21 $pos = 10.5;
23 for($i =0; $i < 6; $i++) {
24 $con->moveTo($pos, -$line[$i]["len"]);
25 $con->lineTo($pos, $line[$i]["len"]);
26 $con->setSourceRgb($line[$i]["r"], $line[$i]["g"], $line[$i]["b"]);
27 $con->stroke();
28 $pos+=10;
30 $con->restore();
31 $con->moveTo(35, -10000);
32 $con->lineTo(35, 10000);
33 $con->setLineWidth(1);
34 //$con->set_source_rgb(0,0,0,);
35 $con->stroke();
37 $sur->writeToPng("long-lines-php.png");