ImageEn, unit iexBitmaps

TIEBitmap.AlphaChannel

TIEBitmap.AlphaChannel


Declaration


property AlphaChannel: TIEBitmap;


Description


TIEBitmap handles the alpha channel as an encapsulated TIEBitmap object with pixelformat of ie8g.
This property returns the associated AlphaChannel.
If an image doesn't have an alpha channel, you can create it just using AlphaChannel property.
To determine whether an image has an alpha channel, examine the HasAlphaChannel property.


Example


// Assign an alpha channel to an image using a source file
// For simple transparency, use a monochrome bitmap where the black pixels will become transparent
// Otherwise, a 256 color gray-scale image can provide a range of tranparency values (from white/fully opaque to black/fully transparent)
aBMP := TIEBitmap.create( 'D:\alpha.bmp' );

// Use our bitmap as the alpha channel
ImageEnView1.IEBitmap.AlphaChannel.Assign( aBMP );

// Ensure size of alpha channel matches size of image (and is ie8g)
ImageEnView1.IEBitmap.SyncAlphaChannel();

// Update the container
ImageEnView1.Update;

aBMP.free;

Source Image:



Image to use for Alpha (Black will become transparent, gray will be 50% transparent and white will be fully opaque):



Result (on a white TImageEnView):




See Also


- SyncAlphaChannel
- DetachAlphaChannel
- ReplaceAlphaChannel