This function layers raster images. It allows you to set an alpha channel.

[C++Builder/Visual C++]     HANDLE IKLayerEx(HANDLE Handle1, HANDLE Handle2, BYTE Trans, BOOL TransColor, BYTE TRed, BYTE TGreen, BYTE TBlue, BYTE BRed, BYTE BGreen, BYTE BBlue, int x, int y, BOOL Clip, BOOL Alpha, IKPROCESSPROC UserProc, LPCTSTR Caption, LPCTSTR Message, LPCTSTR Button);
[Delphi]         function IKLayerEx(Handle1, Handle2: THandle; Trans: Byte; TransColor: LongBool; TRed, TGreen, TBlue, BRed, BGreen, BBlue: Byte; x, y: Integer; Clip, Alpha: LongBool; UserProc: LONG_PTR; Caption, Message, Button: PChar): THandle;
[Visual Basic]   Function IKLayerEx(ByVal Handle1 As Long, ByVal Handle2 As Long, ByVal Trans As Byte, ByVal TransColor As Long, ByVal TRed As Byte, ByVal TGreen As Byte, ByVal TBlue As Byte, ByVal BRed As Byte, ByVal BGreen As Byte, ByVal BBlue As Byte, ByVal x As Long, ByVal y As Long, ByVal Clip As Long, ByVal Alpha As Long, ByVal UserProc As Long, ByVal Caption As String, ByVal Message As String, ByVal Button As String) As Long

Parameters

Name Explanation
Handle1 The handle of the image on which another image is layered. (The image on the bottom) Supports 1, 4, 8, 16, 24, 32 bit images.
Handle2 The handle of the image to be layered. (The image on the top) Supports 1, 4, 8, 16, 24, 32 bit images.
Trans The level of transparency of Handle2 (From 0 to 255, as this value increases the image of Handle2 becomes visible)
TransColor Sets whether or not Handle2 has a transparent color. (False(0): No transparent color, True(non zero): Has transparent color)
TRed Sets the red component of the RGB value of the transparent color for Handle2 (from 0 to 255)
TGreen Sets the green component of the RGB value of the transparent color for Handle2 (from 0 to 255)
TBlue Sets the blue component of the RGB value of the transparent color for Handle2 (from 0 to 255)
BRed 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 Handle1 or Handle2
BGreen 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 Handle1 or Handle2
BBlue 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 Handle1 or Handle2
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 the alpha channel is used. (False(0): Alpha channel is not used, True (nonzero): Alpha channel is used.

* This parameter is used with the IKLayerEx function only. Please refer to the explanation below.

UserProc The address of the user function (If not using the user function then set to 0)
Caption Sets the text displayed in the title bar of the progress dialog box
Message Sets the message displayed in the progress dialog box
Button Sets the name of the button displayed in the progress dialog box

Return Value

Returns the raster image handle if successful (1 bit image). Returns 0 if unsuccessful. In general the resulting image will be 24 bit color. However, if Handle1 and Handle2 are the same bitcount and both images have the same palette then the resultant image will have the same bitcount as the input images. (This is for images with a bit count of 8 or less.)

Explanation

The IKLayerEx function layers raster images. The upper left corner of the Handle2 image is attached to the Handle1 image at the x,y coordinate location.


If the Clip parameter is set to True (nonzero), the size of the created image is the same as the image of Handle 1. Any portions of the Handle2 image that extend beyond the Handle1 image will be clipped. If the Clip parameter is set to False(0), 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 Handle1 image or the Handle2 image will be the color set in the BRed, BGreen, and BBlue parameters. If the TransColor parameter is set to True, the color set by the TRed, TGreen, and TBlue parameters will be a transparent color. When using the alpha channel, set the Alph parameter of the IKLayerEx function to True (nonzero) and set the image handle of a 32 bit RGBA image into the Handle2 parameter. When the Alpha parameter is True, the Trans parameter is disabled. When the Alpha parameter is False(0), the IKLayerEx function is the same as the IKLayer function.


Note: The image handles passed to this function are not freed after execution.


An explanation of the output bitcounts:

If the user function is set or if the Caption, Message, and Button parameters are blank then the Progress dialog box is not displayed. If the Progress dialog box is displayed, it indicates the percentage of the current process completed. For more information about the user function please refer to the Definition of User Function in the Ik10Effect.dll, Ik10EffectA.dll, Ik10Effect64.dll, Ik10Effect64A.dlll section.


[The differences from the ImageKit5]

Function NameParameters
IK5Layer Handle1, Handle2, Trans, TRed, TGreen, TBlue, BRed, BGreen, BBlue, x, y, Clip, EffectUserProc, Caption, Message, Button
IKLayer Handle1, Handle2, Trans, TransColor, TRed, TGreen, TBlue, BRed, BGreen, BBlue, x, y, Clip, UserProc, Caption, Message, Button

The TransColor parameter has been added since ImageKit6. If the TransColor parameter is set to True then the functionality is the same as the ImageKit5. EffectUserProc refers to the same user function as UserProc.

 

The ImageKit10 ActiveX is a product created by Newtone Corporation