Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!wuarchive!rice!uupsi!sunic!kth.se!cyklop.nada.kth.se!news From: nv89-nun@alv.nada.kth.se (Nicklas Ungman) Newsgroups: comp.sys.mac.programmer Subject: Re: COPYBITS Message-ID: Date: 23 Feb 91 14:27:41 GMT References: <1991Feb22.032616.30166@wpi.WPI.EDU> Sender: news@nada.kth.se (Mr News) Organization: Royal Institute of Technology, Stockholm, Sweden Lines: 25 In-reply-to: nuk@wpi.WPI.EDU's message of 22 Feb 91 03:26:16 GMT The problem might be that MyMap is not properly set up. The following procedure shuold work ok. Also see Macintosh Technical Notes #41:Drawing into an Offscreen Bitmap. procedure DoStuff; var OffscreenPort: GrafPort; ... begin MyMap.bounds:=SrcRect; MyMap.rowBytes:=((SrcRect.right - SrcRect.left + 15) div 16)*2; MyMap.baseAddr:=NewPtr(MyMap.rowBytes*LongInt(SrcRect.bottom - SrcRect.top)); OpenPort(@OffScreenPort); SetPortBits(MyMap); {draw stuff} CopyBit(OffScreenPort.portBits,VisibleWindow^.portBits, SrcRect,DestRect,0,NIL); ClosePort(@OffScreenPort); end; /Nixxon