Intrinsic-114 CopyImage

Top  Previous  Next

114: CopyImage(SourceHandle, SX1, SY1, SX2, SY2, DestHandle, DX1, DY1, DX2, DY2);


This intrinsic copies a selected portion of one bitmap to a selected portion of another bitmap. Since the screen is also a bitmap, it can copy between a bitmap and the screen, and vice versa. It can copy one portion of the screen to another portion of the screen, or one portion of a bitmap to another.


The SourceHandle and DestHandle specify the source and destination bitmaps. The variables SX1, SY1, SX2, and SY2, specify the upper-left and lower-right corners of a rectangle that selects part or all of the source bitmap for copying. The variables DX1, DY1, DX2, and DY2 specify the destination rectangle.


If the source and destination rectangles are different sizes, the image will be stretched or shrunk to match. If the source rectangle is smaller than the source bitmap, the copied bitmap will be clipped accordingly. During the copying process, various combinations of Boolean operations can be performed such as AND, OR or XOR. Details of the copying process are controlled by the SetCopyMode intrinsic.


If you are copying images to the Console (handle=-1), controlling Screen Refresh can speed up this intrinsic. See the Console Refresh section for more information.