2 $sur = new CairoImageSurface(FORMAT_RGB24
,165, 30);
3 $con = new CairoContext($sur);
6 $con->setSourceRgb ( 1, 1, 1);
9 $con->setSourceRgb ( 0, 0, 0);
11 $con->translate ( 5, 5);
13 /* First compress the pen to a vertical line. */
14 $con->rectangle ( 0, 0, 20, 20);
15 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
18 $con->scale ( 0.00001, 1.0);
23 $con->translate ( 5 +
20, 0);
25 /* Then compress the pen to a horizontal line. */
26 $con->rectangle ( 0, 0, 20, 20);
27 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
30 $con->scale ( 1.0, 0.00001);
35 $con->translate ( 5 +
20, 0);
37 /* Finally a line at an angle. */
38 $con->rectangle ( 0, 0, 20, 20);
39 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
42 $con->rotate ( M_PI
/ 4.0);
43 $con->scale ( 0.00001, 1.0);
47 $con->setSourceRgb ( 1, 1, 1);
50 $con->setSourceRgb ( 0, 0, 0);
51 $con->setLineJoin (LINE_JOIN_ROUND
);
53 $con->translate ( 5, 5);
55 /* First compress the pen to a vertical line. */
56 $con->rectangle ( 0, 0, 20, 20);
57 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
60 $con->scale ( 0.00001, 1.0);
65 $con->translate ( 5 +
20, 0);
67 /* Then compress the pen to a horizontal line. */
68 $con->rectangle ( 0, 0, 20, 20);
69 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
72 $con->scale ( 1.0, 0.00001);
77 $con->translate ( 5 +
20, 0);
79 /* Finally a line at an angle. */
80 $con->rectangle ( 0, 0, 20, 20);
81 $con->curveTo ( 20 / 2, 0, 20, 20 / 2, 20, 20);
84 $con->rotate ( M_PI
/ 4.0);
85 $con->scale ( 0.00001, 1.0);
89 $sur->writeToPng("degenerate-pen-php.png");