Changed the entire file structure to remove the .c includes from cairo.c
[phpCairo.git] / testcases / phpCairo / set-source.php
bloba8df39270e06514132e99788fced6521e9558277
1 <?
2 $sur = new CairoImageSurface(FORMAT_ARGB32, 5, 5);
3 $con = new CairoContext($sur);
5 $color = "";
6 $color.= chr(0x4c);
7 $color.= chr(0x33);
8 $color.= chr(0x19);
9 $color.= chr(0x80);
11 $s = new CairoImageSurface(FORMAT_ARGB32, 1, 1);
12 $s->createFromData($color, FORMAT_ARGB32, 1,1,4);
14 $pat = new CairoSurfacePattern($s);
15 $pat->setExtend(EXTEND_REPEAT);
17 for($i=0; $i<5; $i++) {
18 switch($i) {
19 case 0:
20 $con->setSourceRgb(.6,.7,.8);
21 break;
22 case 1:
23 $con->setSourceRgba(.2,.4,.6,.5);
24 break;
25 case 2:
26 $con->setSourceRgba(.2,.4,.6,.5);
27 break;
28 case 3:
29 default:
30 $con->setSource($pat);
33 $con->rectangle($i,0,1,5);
34 $con->fill();
36 $sur->writeToPng("set-source-php.png");