Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 29 lines (24 sloc) 0.733 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
<?php
$sur = new CairoImageSurface(CairoFormat::ARGB32, 25*60, 4*60);
$con = new CairoContext($sur);

$dash = array(20.0,20.0);

$con->setSourceRgb(0, 0, 0);
$con->paint();

for($a=0; $a<4; $a++)
for($b=0; $b<5; $b++)
for($c=0; $c<5; $c++) {

    $con->moveTo((($b*5)+$c)*60 + 10, $a*60 + 10);
    $con->relCurveTo(0, $b*10, 0, $b*10, $c*10, $b*10);
    $con->setSourceRgb(1,1,1);
    $con->setLineWidth(8);
    $con->setLineCap(CairoLineCap::ROUND);
    $con->setDash($dash, $a*10);
    $con->strokePreserve();
    $con->setSourceRgb(0,0.5,1);
    $con->setLineWidth(2);
    $con->setLineCap(2);
    $ar = array(8.0,8.0);
    $con->setDash($ar,0);
    $con->stroke();
}

$sur->writeToPng(dirname(__FILE__) . '/dash-curve-php.png');
Something went wrong with that request. Please try again.