gifs
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
(define-module (graphgif))
|
||||
|
||||
(use-modules (cairo))
|
||||
(use-modules (cairo)
|
||||
(cgif))
|
||||
|
||||
(re-export (cairo-pattern-create-rgb . create-color))
|
||||
|
||||
@@ -44,7 +45,7 @@
|
||||
(cairo-stroke cr))))
|
||||
|
||||
(define-public (draw-abstract-graph graph)
|
||||
(let* ([surface (cairo-image-surface-create 'argb32 400 400)]
|
||||
(let* ([surface (cairo-image-surface-create 'rgb24 400 400)]
|
||||
[cr (cairo-create surface)])
|
||||
(define paint-edges (edge-painter cr graph))
|
||||
(define paint-nodes (node-painter cr))
|
||||
@@ -59,7 +60,7 @@
|
||||
|
||||
(define-public (write-graph-to-file graph filename)
|
||||
(define my-surface (draw-abstract-graph graph))
|
||||
(cairo-surface-write-to-png my-surface filename)
|
||||
(make-gif `(,my-surface) filename)
|
||||
(cairo-surface-destroy my-surface))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user