ADC Home > Reference Library > Technical Q&As > Legacy Documents > Mac OS 9 & Earlier >
Legacy Document
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
Technical Q&A QD49
Copybits Bus Error with Offscreen GWorld
|
Q:
I'm attempting to CopyBits an image from a window to an offscreen GWorld,
and I'm getting a Bus Error on some machines but not others.
A:
Your window is partially off the bottom of the screen, and CopyBits is
attempting to read pixels below the bottom of the PixMap . In some cases,
the access is going beyond the video RAM into unmapped memory space,
causing a Bus Error.
Native QuickDraw fixes this problem by comparing the source rectangle to
the source PixMap 's bounds rect, but most 68K versions of QuickDraw do
not check the source rectangle. For best results, constrain your source
rectangle to the limits of the screen. Note that you can't always rely
on the window having useful information, since it might be obscured by
other windows, or it might have been written to by another piece of code
(e.g., games that write directly to the screen, extensions, etc).
|
[Nov 17 1997]