Important: The information in this document is obsolete and should not be used for new development.
UnlockPixels
When you are finished drawing into and copying from an offscreen graphics world, use theUnlockPixelsprocedure.
PROCEDURE UnlockPixels (pm: PixMapHandle);
pm- A handle to an offscreen pixel map. Pass the same handle that you passed previously to the
LockPixelsfunction.DESCRIPTION
TheUnlockPixelsprocedure allows the Memory Manager to move the base address for the offscreen pixel map that you specify in thepmparameter. To ensure the integrity of the data in a pixel image, callLockPixels(explained in the preceding section) before drawing into or copying from a pixel map; then, to prevent heap fragmentation, callUnlockPixelsas soon as your application finishes drawing to and copying from the offscreen pixel map.The
baseAddrfield of thePixMaprecord for an offscreen graphics world contains a handle instead of a pointer (which is what thebaseAddrfield for an onscreen pixel map contains). TheLockPixelsfunction dereferences thePixMaphandle into a pointer. When you use theUnlockPixelsprocedure, the handle is recovered.You don't need to call
UnlockPixelsifLockPixelsreturnsFALSE, becauseLockPixelsdoesn't lock the memory for a pixel image if that memory has been purged. However, callingUnlockPixelson purged memory does no harm.SPECIAL CONSIDERATIONS
TheUnlockPixelsprocedure may move or purge memory blocks in the application heap. Your application should not call this procedure at interrupt time.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for theUnlockPixelsprocedure are
Trap macro Selector _QDExtensions $00040002