Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ncar!ames!haven!umd5!zben From: zben@umd5.umd.edu (Ben Cranston) Newsgroups: comp.sys.mac.programmer Subject: Re: Offscreen BitMaps Summary: Alternate code for computing rowBytes Keywords: bitmap, offscreen Message-ID: <5115@umd5.umd.edu> Date: 20 Jul 89 01:43:09 GMT References: <3023@helios.ee.lbl.gov> Reply-To: zben@umd5.umd.edu (Ben Cranston) Organization: University of Maryland, College Park Lines: 18 What's wrong with this? deep = (**MyGrafPort.portPixMap).pixelSize; rowsize = 2 * ( (15+width*deep) / 16 ); (**MyGrafPort.portPixMap).rowbytes = 0x8000 | rowsize; or deep = MyGrafPort.portPixMap^^.pixelSize; rowsize = ( (width*deep)+15 ) DIV 16 * 2; MyGrafPort.portPixMap^^.rowBytes = BitOr(RowSize,$8000); Admittedly these are Color Quickdraw examples, but how is storage being wasted if you just do a rounded divide by 16 then halve the result? -- Sig DS.L ('ZBen') ; Ben Cranston * Computer Science Center Network Infrastructures Group * University of Maryland at College Park