ImageGear Professional for Windows ActiveX
GenerateAlpha Method

Description:

Creates an alpha channel, based on the data found in pSrcPage and pBackground. The height and width of pBackground must not be less than the height and width of pSrcPage. Here is the formula by which the alpha channel data is calculated (where I2 stands for second image):

A = (I2 - Back) / (abs(I2 - back) - back);

If pBackground is a 1-bit image, you should set ChannelType to IG_ALPHA_CREATE_1. This data will act as overlay data, where the 2 possible values for each bit of overlay data will determine whether the pixel is displayed or is made transparent, so that whatever is in the background will show through.

If pBackground is an 8-bit image, you should set ChannelType to IG_ALPHA_CREATE_8. This will add 8 bits (with 256 possible values) of alpha data for each pixel of pSrcPage.

Syntax:

      GenerateAlpha (ByVal pAlphaPage As IGPage, ByVal pSrcPage As
IGPage, ByVal pBackground As IGPage, ByVal ChannelType As
enumIGAlphaChannelType)

Parameters:

Name Description
pAlphaPage Reference to IGPage Object that stores the newly created alpha channel.
pSrcPage Reference to IGPage Object that stores an image.
pBackground Reference to IGPage Object that stores a background image.
ChannelType Tells ImageGear what bit depth the alpha channel should have.

Return Value:

N/A

Bits Per Pixel:

1, 4, 8, 9-16-bit gray level, 24, 32

Sample:

Image Processing and Effects

 

 


©2016. Accusoft Corporation. All Rights Reserved.

Send Feedback