GRAPHIC COPY statement

Purpose

Copy a bitmap to the selected graphic target.

Syntax

GRAPHIC COPY hbmpSource???, id& [, style&]

GRAPHIC COPY hbmpSource???, id& TO (x!, y!) [, style&]

GRAPHIC COPY hbmpSource???, id&, (x1!, y1!)-(x2!, y2!) TO (x!, y!) [, style%]

Remarks

You can copy a complete bitmap, or a portion of it, to the selected graphic target.  The expression hbmpSource??? specifies the handle of the source GRAPHIC BITMAP,  GRAPHIC WINDOW, or dialog containing a GRAPHIC CONTROL.  The expression id& is the unique control identifier in the range 1 to 65535, as assigned with the CONTROL ADD GRAPHIC statement.  id& must be 0 for a GRAPHIC WINDOW or a GRAPHIC BITMAP.  The destination of the copy operation is the window selected by GRAPHIC ATTACH.  You must take care that your parameters are valid for the specified bitmap, or the results of the operation are undefined.

The first form of the GRAPHIC COPY statement copies the complete bitmap, positioning it at (0,0), which is the upper left corner of the destination.

The second form of GRAPHIC COPY also copies the complete bitmap, but positions it at the point specified by the parameter (x!, y!).

The third form copies a portion of the bitmap, specified by x1,y1 as the upper left corner and x2,y2 as the lower right corner.  It is positioned at  the point specified by the parameter (x,y).  You must use care that your parameters are valid for the specified bitmaps, or results of the operation are undefined.

If the style parameter is included, it is one of the values in the following table.  If not included, a default of %mix_CopySrc is presumed.  There are 8 mix modes available to use for mixing drawing colors with the colors which already exist at the at the drawing location  The mix mode equates are predefined in PowerBASIC.

%mix_Blackness

Pixel is always 0 (black).

%mix_NotMergeSrc

Pixel is the inverse of the MergeSrc color.

%mix_MaskNotSrc

Pixel is a combination of the colors common to both the pixel and the inverse of the source.

%mix_NotCopySrc

Pixel is the inverse of the pen color.

%mix_MaskSrcNot

Pixel is a combination of the colors common to both the source and the inverse of the pixel.

%mix_Not

Pixel is the inverse of the pixel color.

%mix_XorSrc

Pixel is a combination of the colors in the source and in the pixel, but not in both.

%mix_NotMaskSrc

Pixel is the inverse of the MaskSrc color.

%mix_MaskSrc

Pixel is a combination of the colors common to both the source and the pixel.

%mix_NotXorSrc

Pixel is the inverse of the XorSrc color.

%mix_Nop

Pixel remains unchanged.

%mix_MergeNotSrc

Pixel is a combination of the source color and the inverse of the pixel color.

%mix_CopySrc

Pixel is the source color (default).

%mix_MergeSrcNot

Pixel is a combination of the source color and the inverse of the pixel color.

%mix_MergeSrc

Pixel is a combination of the source color and the pixel color.

%mix_Whiteness

Pixel is always 1 (white).

See also

GRAPHIC GET STRETCHMODE, GRAPHIC RENDER, GRAPHIC SET STRETCHMODE, GRAPHIC STRETCH