Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-release > by-pkgid > f907aa52a0688d6b126893a77a301494 > files > 16

ocaml-cairo-devel-0.4.7-0.4.gitbe5a298.mga7.armv7hl.rpm

(* Example by Øyvind Kolås taken from http://cairographics.org/samples/ *)

open Cairo

let () =
  let cr = Cairo.create(Cairo.PDF.create "dash.pdf" 400. 300.) in

  let dashes = [| 50.0;  (* ink *)
                  10.0;  (* skip *)
                  10.0;  (* ink *)
                  10.0   (* skip*)
               |] in
  let ofs = -50.0 in

  set_dash cr dashes ~ofs;
  set_line_width cr 10.0;

  move_to cr 128.0 25.6;
  line_to cr 230.4 230.4;
  rel_line_to cr (-102.4) 0.0;
  curve_to cr 51.2 230.4 51.2 128.0 128.0 128.0;
  stroke cr;

  Surface.finish(get_target cr)