4 $sur = new CairoImageSurface(FORMAT_ARGB32
, $width, $height);
5 $con = new CairoContext($sur);
6 $s = new CairoImageSurface(FORMAT_A1
,$width,$height);
8 $stride = $s->getStride();
10 for($i=0; $i<8; $i++
) {
11 $str=$str . chr(0x14);
12 $str=$str . chr(0xAA);
13 /*$str=$str . chr(255);
22 $s->createFromData($str, FORMAT_A1
, $width, $height);
23 $con->setSourceRgb(0,0,1);
26 $con->setSourceRgb(1,0,0);
27 $con->maskSurface($s,0,0);
28 $sur->writeToPng("a1-mask-php.png");