This method layers two raster images together.

[Visual Basic]
Public Function Layer(bottomImage As Image, topImage As Image, transLevel As Integer, transColor As Boolean, transRed As Byte, transGreen As Byte, transBlue As Byte, backRed As Byte, backGreen As Byte, backBlue As Byte, x As Integer, y As Integer, clip As Boolean, alpha As Boolean) As Boolean
[C#]
public bool Layer(Image bottomImage, Image topImage, int transLevel, bool transColor, byte transRed, byte transGreen, byte transBlue, byte backRed, byte backGreen, byte backBlue, int x, int y, bool clip, bool alpha);

Parameters

bottomImage
      The image on which another image is layered (The image on the bottom). Supports 1, 4, 8, 16, 24, 32 bit images.

topImage
      The image to be layered (The image on the top). Supports 1, 4, 8, 16, 24, 32 bit images.

transLevel
      The level of transparency of topImage (From 0 to 255, as this value increases the image of topImage becomes visible)

transColor
      Sets whether or not topImage has a transparent color. (False(0): No transparent color, True(non zero): Has transparent color)

transRed
      Sets the red component of the RGB value of the transparent color for topImage (from 0 to 255)

transGreen
      Sets the green component of the RGB value of the transparent color for topImage (from 0 to 255)

transBlue
      Sets the blue component of the RGB value of the transparent color for topImage (from 0 to 255)

backRed
      Sets the red component of the RGB value of the background color (from 0 to 255) This is the area of the image that is not part of either bottomImage or topImage

backGreen
      Sets the green component of the RGB value of the background color (from 0 to 255) This is the area of the image that is not part of either bottomImage or topImage

backBlue
      Sets the blue component of the RGB value of the background color (from 0 to 255) This is the area of the image that is not part of either bottomImage or topImage

x,y
      The coordinates of the attachment location (in pixels)

clip
      Sets whether or not the image is clipped (False(0): No clipping, True(nonzero) clipping)

alpha
      Sets whether or not alpha channel is used ifalse: Does not use alpha channel, True: Uses alpha channel

Return Value

Returns True if successful. Returns False if unsuccessful.

Explanation

The Layer method layers two raster images together. The upper left corner of the TopImage is attached to the BottomImage at the x,y coordinate location.

If the Clip parameter is set to True, the size of the created image is the same as the BottomImage. Any portions of the TopImage that extend beyond the BottomImage will be clipped. If the Clip parameter is set to False, the size of the created image is the same as the combination of the two images. Any areas of the created image that are not in either the BottomImage or the TopImage will be the color set in the BackRed, BackGreen, and BackBlue parameters. If the TransColor parameter is set to True, the color set by the TransRed, TransGreen, and TransBlue parameters will be a transparent color.

When the Alpha parameter is True, the raster image set in the TopImage parameter must be a 32-bit RGBA image (A refers to an alpha channel containing a mask image). Note: When the Aalpha parameter is True, the TransLevel parameter is disabled.

If successful the resulting raster image data is set in the DestinationImage property.

The output will be a 24 bit image. However, if either bottomImage or topImage is a 32 bit image, then the output will be a 32 bit image.

See Also

Effect Class | Effect Members

The ImageKit.NET3 is created by Newtone Corporation