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);
15 $con->setSourceRgb(1,1,1);
19 $con->setLineWidth(1);
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"]);
31 $con->moveTo(35, -10000);
32 $con->lineTo(35, 10000);
33 $con->setLineWidth(1);
34 //$con->set_source_rgb(0,0,0,);
37 $sur->writeToPng("long-lines-php.png");