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 theUnlockPixels
procedure.
PROCEDURE UnlockPixels (pm: PixMapHandle);
pm
- A handle to an offscreen pixel map. Pass the same handle that you passed previously to the
LockPixels
function.DESCRIPTION
TheUnlockPixels
procedure allows the Memory Manager to move the base address for the offscreen pixel map that you specify in thepm
parameter. 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, callUnlockPixels
as soon as your application finishes drawing to and copying from the offscreen pixel map.The
baseAddr
field of thePixMap
record for an offscreen graphics world contains a handle instead of a pointer (which is what thebaseAddr
field for an onscreen pixel map contains). TheLockPixels
function dereferences thePixMap
handle into a pointer. When you use theUnlockPixels
procedure, the handle is recovered.You don't need to call
UnlockPixels
ifLockPixels
returnsFALSE
, becauseLockPixels
doesn't lock the memory for a pixel image if that memory has been purged. However, callingUnlockPixels
on purged memory does no harm.SPECIAL CONSIDERATIONS
TheUnlockPixels
procedure 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 theUnlockPixels
procedure are
Trap macro Selector _QDExtensions $00040002