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