Important: The information in this document is obsolete and should not be used for new development.
Saving and Restoring Graphics Ports
If your application draws into more than one graphics port (basic or color), you can use theSetPortprocedure to set the graphics port into which you want to draw. At times you may need to preserve the current graphics port. You can do this by using theGetPortprocedure to save the current graphics port (basic or color), usingSetPortto set the graphics port you want to draw in, and then usingSetPortagain when you need to restore the previous graphics port.
- Note
- When your application runs in Color QuickDraw or uses offscreen graphics worlds, it should use the
GetGWorldprocedure instead ofGetPort, and it should use theSetGWorldprocedure instead ofSetPort. These procedures save and restore the current graphics port for basic and color graphics ports as well as offscreen graphics worlds. See the chapter "Offscreen Graphics Worlds" for more information.![]()
Subtopics
- GetPort
- SetPort