CLIM mail archive

[Prev][Next][Index][Thread]

re: clim 1.0 code for displaying bitmap files



Hi again...
   Let me revise that first function....
It had a spelling error...

; ******************************************************************

;;; use this to create a lisp vector from an x bitmap file.
;;; Then cut and paste the result into an icon file.
(defun load-bmap (fname &aux d)
  (with-open-file
   (file fname :direction :input)
   (dotimes (i 50)
            (push (read-line file nil 'eof) d))
   (setf d (reverse (remove 'eof d))))
  (list (third (read-from-string 
                (format nil "(~A)" (string-trim '(#\#) (first d)))))
        (third (read-from-string 
                (format nil "(~A)" (string-trim '(#\#) (second d)))))
        (mapcar 
         #'(lambda (s) 
             (read-from-string 
              (format nil "#~A" (string-left-trim '(#\0) (format nil "~A" s)))))
         (read-from-string 
          (remove #\} (remove #\; (remove #\, (format nil "~A" (cdddr d))))))))
  )
; ******************************************************************

Also, I never mentioned the calling format... Try something like
(draw-bitmap *window* 20 20 (load-bmap "mybitmapfile"))

         -- Greg



Main Index | Thread Index