guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Example usages of guile-cairo


From: Panicz Maciej Godek
Subject: Re: Example usages of guile-cairo
Date: Sat, 16 Jul 2016 10:05:45 +0200

Hi,
thanks for your reply -- I think I have solved it (although I took a
slightly different approach*) -- the problem was probably that the scale
was too small for anything to be visible, and it was sufficient to enlarge
the values of points.

Of course, if you publish your examples, as it is always a pleasure to read
other people's ideas :)

*the approach was to write my own bindings to cairo, as I intended to
integrate it with my SDL-based framework anyway, so I wrote a module
inspired by cairosdl, with a slightly more scheme-style API, i.e. instead
of passing the cairo context explicitly to each function, one uses the
notion of current drawing context (like there is the notion of current
output port for the display; the difference is that I didn't reify the
drawing context yet), e.g.

(let ((image (make-image 320 200)))
  (with-output-to-surface image
    (lambda ()
      (set-source-rgb! 0 0 0)
      (move-to! 0 0)
      (line-to! 320 240)
      (move-to! 320 0)
      (line-to! 0 240)
      (set-line-width! 2)
      (stroke!)
      image)))

The code is far from complete and far from perfect, but it is available in
the SLAYER repository, in case anybody wanted to check it:
https://bitbucket.org/panicz/slayer/src/ae322e1a1ad21564c4aba3b662ba3d5861eea026/src/drawing.c?at=2-vector-graphics&fileviewer=file-view-default


2016-07-15 22:19 GMT+02:00 Vladimir Zhbanov <address@hidden>:

> Hi Panicz,
>
> Have you solved your issue?
>
> If not, I would recommend to look at README in your guile-cairo
> distribution, it contains some example code. BTW, I have also
> prototyped some C code to make a grid pattern using guile-cairo
> and gnome-gtk and have a little scheme example that I could
> publish if you're still interested.
>
> --
>   Vladimir
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]