CAPI Images Problem
Hi
I am trying to write a simple splash screen for my application.
Here is the code (just subtitute any .bmp file in the code)
I keep getting an error
No applicable methods for #<STANDARD-GENERIC-FUNCTION
COLOR::FIND-COLOR-USER 20C87A7A> with args (NIL)
which, I assume, it happens because the graphics port is not
instantiated yet.
Does anybody have any ideas about how to make something like this work?
Thanks
Marco
=======================================
(defparameter *splash-image*
(gp:read-external-image
(merge-pathnames "goalie-splash.bmp"
(lispworks:current-pathname))))
(capi:define-interface splash-screen ()
((image :accessor splash-screen-image :initform nil)
)
(:panes
(view
capi:output-pane
:display-callback 'display-splash-image
:reader splash-image-view
))
(:layouts
(main
capi:simple-layout
'(view)))
(:default-initargs
:layout 'main
:visible-min-width 300
:visible-min-heigth 300))
(defmethod initialize-instance :after ((sc splash-screen) &key)
)
(defun display-splash-image (pane x y width height)
(with-accessors ((image splash-screen-image))
(capi:top-level-interface pane)
(unless image
(setf image (gp:load-image image *splash-image*))
(gp:invalidate-rectangle pane))
(when image
(when (gp:rectangle-overlap x y (+ x width) (+ y height)
0 0 (gp:image-width image)
(gp:image-height image))
(gp:draw-image pane image 0 0)))))
=======================================