Lisp HUG Maillist Archive

capi screen capturing

Hi everyone. I'm having problems capturing images from a canvas using 
LispWorks capi
gui on mac os x. This is the relevant code.

(defpackage :capture-test
  (:add-use-defaults t)
  (:use :capi))

(in-package :capture-test)

(defun sv (pane x y)
  (save-port-image pane "test.bmp"))

(define-interface image-capture-test ()
  ()
  (:panes
   (mainpane output-pane
             :input-model
             '(((:button-1 :press)
                sv))
             :display-callback
             'display-function)))

(defun save-port-image (port file)
  (let ((img (gp:externalize-image port (gp:make-image-from-port
port))))
    (gp:compress-external-image img)
    (gp:write-external-image img
                             file)))

I'm not sure if I'm using the various external-image manipulation
functions correctly because the documnetation runs a bit dry at that
point, and there's nothing on the internet. When I call save-port-image
I get an error in the externalize-image function saying "in ZEROP of
(NIL) arguments should be of type NUMBER". When I provide a result in the 
debugger it then saves the image perfectly.
If anyone has encountered this problem before, or even has the source code 
for externalize-image I'd love some help.
Thanks
rob c

_________________________________________________________________
Want to block unwanted pop-ups? Download the free MSN Toolbar now!  
http://toolbar.msn.co.uk/


Updated at: 2020-12-10 08:52 UTC