# SetImageMask

## Description

Copies a color channel from one image to another. You can specify the source and destination channels using the values 1,2,3,4 to represent red,green,blue,alpha respectively.
This is a slow command and should not be called every frame.
The x,y offset values allow you to offset the source image on te destination image so a small source image can be used to mask any part of a large image. Any part of the large image outside the size of the small image will be left unchanged. negative offset values are supported to shift the source image off the top left of the destination image. If you add some transparent pixels to an image that currently has none, and you use the image on a sprite, then be sure to use SetSpriteTransparency to make the sprite transparent.

## Definition

SetImageMask( iDstImage, iSrcImage, dst, src, x, y )

void agk::SetImageMask( UINT iDstImage, UINT iSrcImage, int dst, int src, int x, int y )

## Parameters

- iImageIndex - The ID of the image to change.
- iSrcImage - The ID of the image to use as a source.
- dst - The ID of the color channel to use as the destination, 1-4 for RGBA,
- src - The ID of the color channel to use as the source, 1-4 for RGBA,
- x - The x offset for the source image on the destination image,
- y - The y offset for the source image on the destination image.