From: ··············@hotmail.com
Subject: capi/cocoa capturing
Date: 
Message-ID: <1117394651.638416.254820@g47g2000cwa.googlegroups.com>
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 "/Users/robbie/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 tyoe NUMBER"
If anyone has encountered this problem before, or has experience with
the capi, or even the source code for externalize-image (that'd be
nice) I'd love some help. Thanks, and sorry to the 99% of you for whom
this is completely tedious.
rob c