The copyArea:gc:srcX:srcY:width:height:destX:destY: method enables the contents of any
CgDrawable object (window or pixmap) to be copied to another
CgDrawable object. The receiver is the source drawable. The first argument is the destination drawable. The source and destination can be the same drawable. Additional arguments include the graphics context, the source rectangle to be copied (
srcX:,
srcY:,
width:, and
height:), and the location in the destination (
destX: and
destY:) to begin the copying operation.
GXhighlight functions differently when copying areas than when drawing using the foreground or background
CgGC components. In the latter case the foreground and background colors are exchanged in the destination. When copying areas,
GXhighlight performs a binary exclusive-OR on the current source and destination pixel values and sets the destination pixel value to the result. The example in the following subsection illustrates copying a pixmap.