Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!psuvax1!xavier!jackiw From: jackiw@cs.swarthmore.edu (Nick Jackiw) Newsgroups: comp.sys.mac.programmer Subject: ARGH!! Trivial Question; Please Help Message-ID: Date: 7 Mar 90 20:53:44 GMT Sender: news@xavier.swarthmore.edu (USENET News System) Organization: Visual Geometry Project, Swarthmore College, PA Lines: 47 I've been knocking myself out over a simple (stupid) question: I want to copyBits from one pixmap to another without using any cGrafPorts. How? IM V says "CopyBits now accepts either bitMaps or pixMaps as parameters." Obviously, CopyBits(pixMapHandle^^,pixMapHandle^^,...) isn't going to work; pixMapHandle^^ is not the same type as BitMap, and even if I coerce it into so believing, with CopyBits(BitMapHandle(PixMapHandle)^^,) I'm hacking off many of the fields of the pixMap (including important ones like pixelDepth) and I get stack overflows, bus errors, and other symptoms of the Wrong Approach. In that thePort^.portBits can still be passed, and that its format is now thePort^.portBits equivalent bytes in cGrafPort baseAddr PortPixMapHandle; rowBytes portVersion bounds grafVars I assume copyBits checks the rowBytes of a passed bitmap to see if (two high bits set) the baseAddr contains a pixMapHandle or if (two high bits clear) the baseAddr contains a regular bit-map bit-image. Thus I'd assume that aBitMap:=thePort^.portBits (where thePort is pointing to a cGrafPtr, not a grafPtr), would fill in the appropriate values for copyBits to know it was getting a pixMap, and then aBitMap.baseAddr:= ptr(myPixMapHand) before CopyBits would tell it which bitMap. Also not so--while the system errors stop, the results aren't right either (the offscreen pixmap, when copied, copies as ultra-slow all black regardless of the contents of its baseAddr field). NEITHER OF THESE METHODS ARE RIGHT. WHAT'S THE RIGHT WAY? (Or must I use a pixMap embedded in a port? What a shameful waste.) Thanks! -- ------------------------ Nick Jackiw jackiw@cs.swarthmore.edu "Just break out the Visual Geometry Project jackiw@swarthmr.bitnet rum so we seem natural!" Swarthmore College, PA 19081-1397 -F. Franklin