Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!crackers!m2c!wpi.WPI.EDU!nuk From: nuk@wpi.WPI.EDU (Jacob W Anderson) Newsgroups: comp.sys.mac.programmer Subject: COPYBITS Message-ID: <1991Feb22.032616.30166@wpi.WPI.EDU> Date: 22 Feb 91 03:26:16 GMT Organization: Worcester Polytechnic Institute Lines: 33 In a pascal program, I am using the CopyBits function to copy from an offscreen port to a window, I am having problems in getting the data from the offscreen port to the window. My code: procedure DoStuff; var MyMap:BitMap; SrcPort:GrafPtr; DestPort:GrafPtr; SrcRect:Rect; {Predefined and initialized} DestRect:Rect; {Predefined and initialized} OffScreenPort:GrafPtr; begin OffScreenPort:=NewPtr(SIZEOF(GrafPort)); MyMap.baseAddr:=NewPtr(81000) {Size of rectangle to copy, bytes} MyMap.bounds:=SrcRect; MyMap.rowBytes:=(MyMap.bounds.right - MyMap.bounds.left) div 8); OpenPort(OffScreenPort); OffScreenPort.portBits:=MyMap; {draw stuff} CopyBit(OffScreenPort.portBits,VisibleWindow^.thePort.portBits, SrcRect,DestRect,0,NIL); ClosePort(OffScreenPort); end; This copies junk from somewhere into the visible window properly, but the junk is not what I desire to be in the window. I am using THINK Pascal 3.0 on a MacSE. Thanx Please respond via E-mail to nuk@wpi.wpi.edu -jake