[cl-gd-devel] fill shapes with transformation?
Jeff Cunningham
jeffrey at cunningham.net
Sat Oct 20 01:51:43 UTC 2007
Hi;
I'm probably doing something wrong, but I can't figure out how to draw
rectangles with a fill color using a transformation.
The code below illustrates the problem I'm having. The first
draw-rectangle should be filled in red. It isn't drawn at all. The
second rectangle is outlined in blue as it should be. Both these two use
a transformation to place the rectangle. The third does not and it fills
just fine.
Is this expected behavior? Or am I doing something wrong?
Thanks.
--Jeff
(with-image* (200 200)
(allocate-color 68 70 85)
(let ((fn "test.png")
(red (allocate-color 255 0 0))
(white (allocate-color 255 255 255))
(blue (allocate-color 0 0 100)))
(with-transformation (:x1 -100 :x2 100 :y1 -100 :y2 100)
(draw-rectangle* -30 -30 30 30 :color red :filled t)
(draw-rectangle* -20 -20 20 20 :color blue :filled nil))
(without-transformations
(draw-rectangle* 95 95 105 105 :color white :filled t))
(write-image-to-file fn :if-exists :supersede)
(sb-ext:run-program "/usr/bin/xv" (list fn))))
More information about the Cl-gd-devel
mailing list