Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!uunet!sco!jamesm From: jamesm@sco.COM (James M. Moore) Newsgroups: comp.sys.mac.programmer Subject: Re: Saving area under dialog boxes (Re: WingZ) Message-ID: <2776@viscous.sco.COM> Date: 1 May 89 19:15:44 GMT References: <2993@tank.uchicago.edu> <29855@apple.Apple.COM> Reply-To: jamesm@sco.COM (James M. Moore) Distribution: na Organization: The Santa Cruz Operation, Inc. Lines: 29 In article <29855@apple.Apple.COM> keith@Apple.COM (Keith Rollin) writes: >>I refresh my image) for permanent storage when the drawn object is done (i.e, >>on MouseUp). Wouldn't there be times when you need to CopyBits from screen >>memory to your offscreen buffer? I suppose one _could_ draw to your offscreen >>bugger and CopyBits it on screen constantly, but that sounds fairly awful in >>terms of speed, etc. > >I'm afraid that I don't see the problem here. Either you draw to the screen >and copy it to an offscreen buffer, or you draw to an offscreen buffer and >copy it to the screen. But if/when context switching becomes preemptive, you can't be sure that something like this won't happen: draw to screen ** context switch - someone else puts another window on the screen, which erases part of your window ** context switch - back to paint program update event generated for application window copy screenbits to buffer - we've just copied a blank screen. In the case of the paint program, the speed hit for drawing offscreen first probably wouldn't be that large. Just pick a small section of the drawing to copy back and forth. -- ** James Moore ** ** Internet: jamesm@sco.com ** ** uucp: {decvax!microsoft | uunet | ucbvax!ucscc | amd}!sco!jamesm ** ** Nil clu no suim ar bith ag SCO ceard a bhfuil me ag scriobh anois. **