Programmer Reference : Common Graphics : Using pixmaps : Copying pixmaps to and from windows
Copying pixmaps to and from windows
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.
How the bits are displayed is dependent on the raster operation function, either GXcopy or GXhighlight, that has been set in the graphics context. The raster operation specifies a binary function that is applied at each pixel, using the current pixel values of the source and the destination to determine the new pixel value of the destination.
GXcopy sets the destination pixel value to the source pixel value; the current destination pixel value is ignored.
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.
Last modified date: 01/29/2015