Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: 3K "limitation" for CopyBits Message-ID: <7731@hoptoad.uucp> Date: 21 Jun 89 19:35:02 GMT References: <3224@ncsuvx.ncsu.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 24 In article <3224@ncsuvx.ncsu.edu> jnh@ecemwl.UUCP (Joseph N. Hall) writes: >Does the 3K-byte suggested restriction for CopyBits (mentioned in IM I) >still apply? Does any such "restriction" still apply? Obviously, even >a large menu requires more than 3K of cached bitmap underneath; is there >any advice on what the limits on the maximum size of a CopyBits transfer >ought to be? The whole screen? Whatever will fit on the stack? I have it on fairly good authority that what happens in CopyBits is that each row gets pushed onto the stack. therefore, it is not so much the total size of the bitmap, but the width, that determines the safety. If you do a MacPaint file bitmap complete, that's safe, because the bitmap is narrow despite being over 50K. On the other hand, if you do a single row that stretches from here to Cleveland, then you could be in big trouble from the stack sniffer. Very wide bitmaps should be broken up into narrower ones to do CopyBits. You should be able to do this by twiddling the source and destination rectangles. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com Postal: 424 Tehama, SF CA 94103; Phone: (415) 495-2934 "I slept with Faith, and found a corpse in my arms on awaking; I drank and danced all night with Doubt, and found her a virgin in the morning." -- Aleister Crowley, THE BOOK OF LIES