Cairo
Cairo 2D Graphics library binding for Raku
Synopsis
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
doc/screenshot/arc-negative.png
image doc/screenshot/arc-negative.png not found
doc/screenshot/arc.png
image doc/screenshot/arc.png not found
doc/screenshot/clip-image.png
image doc/screenshot/clip-image.png not found
doc/screenshot/clip.png
image doc/screenshot/clip.png not found
doc/screenshot/curve-rectangle.png
image doc/screenshot/curve-rectangle.png not found
doc/screenshot/curve_to.png
image doc/screenshot/curve_to.png not found
doc/screenshot/dash.png
image doc/screenshot/dash.png not found
doc/screenshot/fill-and-stroke.png
image doc/screenshot/fill-and-stroke.png not found
doc/screenshot/fill-style.png
image doc/screenshot/fill-style.png not found
doc/screenshot/gradient.png
image doc/screenshot/gradient.png not found
doc/screenshot/image-pattern.png
image doc/screenshot/image-pattern.png not found
doc/screenshot/image.png
image doc/screenshot/image.png not found
doc/screenshot/multi-page-pdf.pdf
image doc/screenshot/multi-page-pdf.pdf not found
doc/screenshot/multi-segment-caps.png
image doc/screenshot/multi-segment-caps.png not found
doc/screenshot/rounded-rectangle.png
image doc/screenshot/rounded-rectangle.png not found
doc/screenshot/set-line-cap.png
image doc/screenshot/set-line-cap.png not found
doc/screenshot/set-line-join.png
image doc/screenshot/set-line-join.png not found
doc/screenshot/svg-surface.svg
image doc/screenshot/svg-surface.svg not found
doc/screenshot/text-align-center.png
image doc/screenshot/text-align-center.png not found
doc/screenshot/text-extents.png
image doc/screenshot/text-extents.png not found
doc/screenshot/text.png
image doc/screenshot/text.png not found