Intrinsic-116 SetCopyMode

Top  Previous  Next

116: SetCopyMode(Mode, Alpha, R, G, B);


This Instrinic sets the way the CopyImage intrinsic works. The arguments control various aspects of the copying process.


Mode. The Mode value controls the way the copy process works. A detailed description of each mode is provided below.


Alpha. The Alpha value controls the transparency of the image and/or the individual pixels.


R,G,B. Depending on the mode, the R,G,B value controls which colors are affected by the transparency.  EXPL supports special RGB modes that make them compatible with pervious VGA color palettes and versions of XPL0.


Mode-0. The images are copied normally.


Mode-1. Specifies that a transparent color can be selected. The R,G,B value specifies the transparent color. Any pixel that matches this color will be completely transparent. All other pixels will be opaque. Click here for detailed information about Transparency.


Mode-2. The image is copied with the whole image's transparency set by Alpha. If the Alpha value is 0, the whole image is transparent. If the Alpha value is 255, the whole image is opaque.


Per-Pixel Mode. If the high byte of the Alpha value in mode-12 is non-zero, the copy process also uses the transparency of each individual pixel in combination with the overall Alpha value. Click here for detailed information about Transparency.


Mode-3. ANDs source and destination.


Mode-4. ORs source and destination.


Mode-5. XORs source and destination.


Mode-6. Inverts the destination image, ignores source.


Mode-7. Inverts source and copies it to destination.


Mode-8. Inverts source and ORs with destination.


Mode-9. ORs source and destination and inverts.


Mode-10. Inverts destination and ANDs it with source.


Mode-11. Copies the source to destination, converting the destination to a mask. The specified R,G,B color will be set to white, and the rest of the image set black. The mask can then be used used to draw sprites using an AND and OR operation.


Mode-12. This mode enables you to set the individual pixels in an image to different levels of transparency. It does this by copying the source to destination, and setting the Alpha or transparency for individual pixels based on the specified RGB color. Any pixel whose color matches the RGB color is set to have its transparency specified by Alpha. If the high byte of Alpha is zero, non-matching pixels are reset to an Alpha of 255, or totally opaque. If the high byte is non-zero, non-matching pixels are unmodified. This enables you to selectively set different colors to different levels to transparency. Once you have set the one or more sets of pixels of a bitmap to a specific transparency, Mode-2 and Per-Pixel mode are used to render or copy the image with the various combinations of transparency. Click here for detailed information about Transparency.


Mode-13, 14, 15, 16, 17. These modes copy and flip along the X or Y axes, or rotate the bitmap by multiples of 90 degrees:


Mode-13 - Flips the bitmap horizontally                Mode-14 - Flips the bitmap vertically

Mode-15 - Rotates 90 degrees clockwise                Mode-16 - Rotates 180 degrees clockwise

Mode-18 - Rotate 270 degrees clockwise


The destination bitmap is resized to accommodate the rotated image. Warning: Do not use this mode to copy directly to the screen because it will resize the screen and change the resolution. Always copy to another bitmap before copying to the screen.