This method layers two raster images together.

[Visual Basic] Public Function Layer(bottomImage As System.Drawing.Image, topImage As System.Drawing.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(System.Drawing.Image bottomImage, System.Drawing.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j

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 the Layer method is successful and the DestinationAsImageKitImage property is True, the resulting image will be set in the Image property or in the Layer(LayerNumber).Image property, according to the value set in the LayerNumber property.

If the Layer method is successful and the DestinationAsImageKitImage property is False, the resulting image will be set in the DestinationImage property.

Regarding the bitcount of the created image:
If the bottomImage and the topImage are both 8 bit less and they are the same bitcount, and they use the same palette, then the created image will be that bitcount and that palette.
If the bottomImage and the topImage are both 8 bit less but they are a different bitcount, or they use a different palette, then the created image will be 24 bit color.
If the bottomImage and the topImage are 16 bit or more, then the created image will be same bitcount as the image with the largest bitcount.

See Also

ImageKit.Effect Members | Newtone.ImageKit.Wpf.ImageKit

 

The ImageKit WPF is created by Newtone Corporation