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
On 2005-05-29 15:24:21 -0400, ··············@hotmail.com said:
> I'm having problems capturing images from a canvas using LispWorks capi
> gui on mac os x. This is the relevant code.
You are much more likely to get a useful response to this request on
<·················@lispworks.com> which you will need to subscribe to
at <http://www.lispworks.com/community/lisp-hug.html>. FWIW I use LWM
and cocoa, but I don't use CAPI - I just load .nib files and call the
relevant cocoa framework calls using objc:invoke. BTW,
performSelectorOnMainThread:withObject:waitUntilDone: is crucial for
anything that diddles a gui element directly (setTitle:,
makeKeyAndOrderFront:, etc.) since the cocoa frameworks are not
generally thread safe.
regards