Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Imaging With QuickDraw /
Chapter 5 - Graphics Devices / Graphics Devices Reference


Application-Defined Routine

Your application can use the DeviceLoop procedure (described on page 5-28) before drawing images that are optimized for every screen they cross. The DeviceLoop procedure searches for video devices that intersect your drawing region, and it calls a drawing procedure that you define for every different video device it finds.

For each video device that intersects a drawing region that you define (generally, the update region of a window), DeviceLoop calls your drawing procedure. Because DeviceLoop provides your drawing procedure with the pixel depth and other attributes of the current device, your drawing procedure can optimize its drawing for whatever type of graphics device is the current device. When highlighting, for example, your application might invert black and white when drawing onto a 1-bit video device but use magenta as the highlight color when drawing onto a color video device. In this case, even were your window to span both a black-and-white and a color screen, the user sees the selection inverted on the black-and-white screen, while magenta would be used to highlight the selection on the color screen.

You must provide a pointer to your drawing procedure in the drawingProc parameter for DeviceLoop.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996