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

seedFill -- need example



Several kind people pointed me to the traps seedFill and seedCFill for
flooding an area with paint (a-la the MacPaint paint bucket). 
Unfortunately, my attempts to use seedFill have all crashed MCL.  If it
wouldn't be too much trouble, could someone help me with an example?

To give you insight into my misunderstanding, here is what I tried most
recently:

(defun my-seed-fill (b/w-window h &optional v)
  "Flood the region at h,v with paint."
  (let ((h (if v h (point-h h)))
        (v (if v v (point-v h))))
    (with-focused-view b/w-window
      (let ((wptr (wptr b/w-window)))
        (let ((srcPtr (pref wptr windowrecord.portbits))
          (dstPtr (pref wptr windowrecord.portbits))
          (srcrow (pref (pref wptr windowrecord.portrect)
                        rect.right))
          (dstrow (pref (pref wptr windowrecord.portrect)
                        rect.right))
          (words  (pref (pref wptr windowrecord.portrect)
                        rect.right))
          (height (pref (pref wptr windowrecord.portrect)
                        rect.bottom)))
      (#_seedFill srcptr dstptr srcrow dstrow height words h v))))))

#|

;;;This goes "boom":

(setq *w* (make-instance 'window))
(frame-rect *w* 20 20 100 100)
(my-seed-fill *w* 50 50)       ; flood the rectangle w/ paint

|#

An example using seedCFill would be useful, too, if anyone has
time/knowledge/inclination.

Thank you for your kind attention.

-Tom  (mcdougal@cs.uchicago.edu)