[comp.sys.mac.programmer] Saving/Restoring screen using off-screen pixMap

maunsell@cvs.rochester.edu (John Maunsell) (01/17/91)

I have several programs that save portions of the screen to an
off-screen bitMap so that screen contents can be updated quickly
at a later time.  I've had no problems using bitMaps,i but I can't 
get off-screen pixMaps to work properly.  The contents (lines, ovals, 
etc) of the restored region are returned intact, but the colors are 
often changed.

My guess is that I am not handling the offscreen pixMap CLUT properly, 
but I don't know what to change.  I am setting up the offscreen pixMap 
CLUT as described in Tech Note 120 (I haven't got a copy of Tech Note 
277).  Drawing off-screen and then copying to the screen seems to work.
Any suggestions?

John Maunsell
University of Rochester
maunsell@cvs.rochester.edu

hairston@henry.ece.cmu.edu (David Hairston) (01/17/91)

[maunsell@cvs.rochester.edu (John Maunsell) writes:]
[] I have several programs that save portions of the screen to an
[] off-screen bitMap so that screen contents can be updated quickly
[] at a later time.  I've had no problems using bitMaps,i but I can't 
[] get off-screen pixMaps to work properly.  The contents (lines, ovals, 
[] etc) of the restored region are returned intact, but the colors are 
[] often changed.

don't forget to set the high bit of <bitmap>.rowBytes to indicate that
this bitmap is being used as a pixmap.  i don't recall what TN.120
says but also don't forget to set the foreground color to black and
the background color to white for CopyBits on PixMaps.  (Ref. IM-V).
i'm not sure this is your problem but these two areas are often
overlooked.

  -dave-  
hairston@henry.ece.cmu.edu