[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: firstname.lastname@example.org
- From: email@example.com (Louie Weitzman)
- Date: Tue, 9 Aug 1994 14:17:22 -0500
hi, i'm interested in drawing a bitmap that uses a mask which is created
from a bitmap of part of the image. i've successfully used regions (using
circles, rectangles or lines) and the copybits function to mask images.
what i can't figure out is how to put a bitmap into a region (then use the
copybits function) or use the copymask function which seems to be the way
below is some code that doesn't work. any pointers would be great!!!
;;; i have the image handles of both the source image and the mask image
;;; created from reading a pict resource. i create a pixmap of them and
;;; that in the copymask function.
(defmethod draw-masked-image ((layout-image layout-image))
(with-slots (image-pixmap mask-pixmap mask-handle image-handle) layout-image
(let ((wptr (slot-value layout-image 'wptr)))
(setf image-pixmap (ccl::pixmap-from-pict image-handle 24))
(setf mask-pixmap (ccl::pixmap-from-pict mask-handle 24))
(ccl::with-pointers ((src image-pixmap)
(dst (rref wptr windowrecord.portbits)))
(let ((src-rect (rref src pixmap.bounds :storage :pointer)))
(rlet ((dst-rect :rect :topleft 0 :bottomright (view-size
(#_copymask src mask-pixmap dst src-rect src-rect dst-rect))))))))