You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You need the development files of Cairo (see the
conf-cairo
package)
and the OCaml package
lablgtk2 (in the OPAM package
lablgtk).
Compilation & Installation
The easier way to install this library — once the prerequisites are set
up — is to use opam:
opam install cairo2
If you would like to compile from the sources, install Dune
opam install dune
and do:
dune build @install
or just make. You can then install it with:
dune install
Examples
You can read a version of the
Cairo tutorial using
this module. The code of this tutorial is available in the
examples/ directory. To compile it, just do
dune build @examples
All the examples below are available (with some comments) by clicking
on images in the tutorial.
Basic examples
stroke.ml shows how to draw (stroke) a simple
rectangle on a PNG surface.
stroke.ml shows how to fill a simple
rectangle on a PNG surface.
showtext.ml illustrates how to select a font
and draw some text on a PNG surface.
paint.ml shows how to paint the current source
everywhere within the current clip region.
mask.ml shows how to apply a radial transparency
mask on top of a linear gradient.