Declaration
property AlphaLocation: TIEAlphaLocation;
Description
Specifies how the alpha channel (transparency) is handled by the image.
Value | Description |
iaAlphaChannel | A TIEBitmap is used to store the transparency of the image. It is accessible via AlphaChannel and can be manipulated by all standard ImageEn functionality |
iaRGBA | Uses the A channel of a 32bit RGBA (ie32RGB) format image. In this location, the alpha channel can only be manipulated using Pixels_ie32RGB or Alpha |
ImageEn's native alpha support uses an
AlphaChannel, which is
TIEBitmap so it can be edited and manipulated using all standard ImageEn methods.
Some windows methods use an RGBA format, e.g.
copying from a 32bit bitmap or loading an Bitmap, WebP or SVG in
Native Pixel Format. In these situations, AlphaLocation will be iaRGBA, which ImageEn will use for display. Any operation that makes use of the native
AlphaChannel will automatically convert the AlphaLocation to iaAlphaChannel.
Notes:
◼AlphaLocation has no effect unless the
pixel format is ie32RGB
◼If you access the
AlphaChannel, AlphaLocation will be set to iaAlphaChannel
◼If the AlphaLocation is iaRGBA, then setting it to iaAlphaChannel will copy the RGBA "A" channel to the
AlphaChannel◼If the AlphaLocation is iaAlphaChannel, then setting it to iaRGBA will copy the
AlphaChannel to the RGBA "A" channel (if it is valid). To prevent this
remove the alpha channel before setting AlphaLocation
◼To load an image in 32bit RGBA format (Bitmap, SVG, WebP or WIC formats) set
NativePixelFormat := True
Default: iaAlphaChannel
// Load an SVG image in ie32RGB format using tranparency from the RGBA "A" channel
ImageEnView1.IO.Params.NativePixelFormat := True;
ImageEnView1.IO.LoadFromFile( 'D:\World.svg' );
// >>> AlphaLocation will be iaRGBA
// Load a PNG with an alpha channel and and display using RGBA
ImageEnView1.IO.LoadFromFile( 'D:\32bit Alpha.png' );
ImageEnView1.IEBitmap.PixelFormat := ie32RGB;
ImageEnView1.IEBitmap.AlphaLocation := iaRGBA; // Move alpha to RGBA channel
ImageEnView1.Update();
See Also
◼SynchronizeRGBA◼AlphaChannel◼NativePixelFormat