Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!pasteur!ames!zodiac!deimos!ddisabat From: ddisabat@deimos.ADS.COM (David Disabatino) Newsgroups: comp.sys.mac.programmer Subject: Help with LSC 3.0 CopyBits Message-ID: <7731@zodiac.UUCP> Date: 28 Apr 89 21:45:38 GMT Sender: news@zodiac.UUCP Reply-To: ddisabat@ads.com (David Disabatino) Distribution: na Organization: Advanced Decision Systems, Mt. View, CA (415) 960-7300 Lines: 34 I am having some trouble with Copybits used to copy a pixmap into a window pixmap. I have created a pixmap for an image loaded in. The data is in a nonrelocatable block in the heap. I create a pixmap for the image (8 bits / pix) pixhndl = NewPixMap(); (**pixhndl).rowBytes = image.width; (**pixhndl).bounds = StuffRect(0, 0, image.width, image.length); (**pixhndl).baseAddr = (Ptr)image.data; image.pmap = pixhndl; Then I try to copybits this pixmap onto a window. SetRect(&srcrect, 0, 0, image.width, image.length); SetRect(&dstrect, 0, 0, image.width, image.length); CopyBits(image.pmap, &srcrect, win->portPixMap, &dstrect, srcCopy, NULL); It doesn't crash or anything, but I see no visible results on screen. Maybe the call to CopyBits is wrong? But any other combination of args gives compiler errors. Is it legal to set up a pixmap like this without a GrafPort. I know the data is there, because if I physically write it into the window pixmap it appears on screen, albeit rather slowly. for (i = 0 ; i < img.length ; i++) for (j = 0 ; j < img.width ; j++) *((**win->portPixMap).baseAddr + j + (i * ((**win->portPixMap).rowBytes & 0x1FFF))) = *(img.data + j + (i * img.width)); This works fine. Of course there are a few casts in the above staement. Please if anyone knows how to copy pixmaps, clue me in. thanks dd