TIOParams.BMP_HandleTransparency
TIOParams.BMP_HandleTransparency
Declaration
property BMP_HandleTransparency: Boolean;
Description
BMP files can have up to 32 bits per pixel. This property controls how to interpret the extra byte in the 32 bit word.
When BMP_HandleTransparency is true the extra byte is interpreted as an alpha channel, otherwise it is just ignored.
So if BMP_HandleTransparency = True the image will be displayed in ImageEn with transparency. Whereas if BMP_HandleTransparency = False the transparent color will not be used.
Default: False
Examples
// if BMP_HandleTransparency = true then display with transparency
ImageEnView1.IO.Params.BMP_HandleTransparency := chkBMPHandleTransparency.Checked;
ImageEnView1.IO.LoadFromFile( FilePath );
// Convert Alpha PNG to 32bit BMP
iebmp := TIEBitmap.Create();
iebmp.Read( 'D:\OriginalAlpha.png' );
iebmp.ParamsEnabled := True;
iebmp.Params.BMP_HandleTransparency := True; // Assign BMP transparency to alpha channel
iebmp.Write('D:\BMP32.bmp');
iebmp.Free;
// Convert 32bit BMP to Alpha PNG
iebmp := TIEBitmap.Create();
iebmp.ParamsEnabled := True;
iebmp.Params.BMP_HandleTransparency := True; // Alpha Channel will be saved (as a 32bit RGBA BMP)
iebmp.Read('D:\BMP32.bmp');
iebmp.Write('D:\Alpha.png');
iebmp.Free;
See Also
-
SynchronizeRGBA