Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!usc!apple!Apple.COM!lsr From: lsr@Apple.COM (Larry Rosenstein) Newsgroups: comp.sys.mac.programmer Subject: Re: Offscreen BitMaps Message-ID: <2910@internal.Apple.COM> Date: 19 Jul 89 00:48:47 GMT References: <3023@helios.ee.lbl.gov> Sender: usenet@Apple.COM Organization: Objects-R-Us, Apple Computer, Inc. Lines: 25 In article <3023@helios.ee.lbl.gov> osborn@ux1 (James R Osborn) writes: > The code I am refering to is that which calculates the necessary > rowbytes for your bitmap: The March 1, 1988 version of Tech Note 41 does the calculation as: rowBytes := (((right - left) + 15) div 16) * 2; with the equivalent translation to C. > rowBits = ourRect.right - ourRect.left; > numBytes = rowBits / 8; > > if (odd(numBytes)) /* You must write your own odd() */ > numBytes += 1; > else if (rowBits % 8) /* % is mod for pascal people */ > numBytes += 2; What if rowBits ends up being 35? Your code seems to result in numBytes == 4, when it should be 6. Larry Rosenstein, Apple Computer, Inc. Object Specialist Internet: lsr@Apple.com UUCP: {nsc, sun}!apple!lsr AppleLink: Rosenstein1