Fork me on GitHub

Cairo 2D Graphics library binding for Perl 6

Cairo 2D Graphics library binding for Perl 6

Synopsis

1
2
3
4
5
6
7
8
9
10
use Cairo;
given Cairo::Image.create(Cairo::FORMAT_ARGB32, 128, 128) {
given Cairo::Context.new($_) {
.rgb(0, 0.7, 0.9);
.rectangle(10, 10, 50, 50);
.fill :preserve; .rgb(1, 1, 1);
.stroke
};
.write_png("foobar.png")
}

Native Cairo library

In order to use this module, native Cairo library is needed. See instructions at https://cairographics.org/download/.

Examples

arc-negative.png

doc/screenshot/arc.png
arc.png

doc/screenshot/clip-image.png
clip-image.png

doc/screenshot/clip.png
clip.png

doc/screenshot/curve-rectangle.png
curve-rectangle.png

doc/screenshot/curve_to.png
curve_to.png

doc/screenshot/dash.png
dash.png

doc/screenshot/fill-and-stroke.png
fill-and-stroke.png

doc/screenshot/fill-style.png
fill-style.png

doc/screenshot/gradient.png
gradient.png

doc/screenshot/image-pattern.png
image-pattern.png

doc/screenshot/image.png
image.png

doc/screenshot/multi-page-pdf.pdf
multi-page-pdf.pdf

doc/screenshot/multi-segment-caps.png
multi-segment-caps.png

doc/screenshot/rounded-rectangle.png
rounded-rectangle.png