ImageEn, unit imageenproc

TImageEnProc.AlphaFill

TImageEnProc.AlphaFill


Declaration

procedure AlphaFill(Value: Byte); overload;
procedure AlphaFill(StartValue, EndValue: Byte; Direction: TIEGradientDir = gdVertical); overload;


Description

Set the transparency for the selected region. Either setting the alpha channel to a single value, or graduating from one value to another (gradient transparency).

0 is transparent, 255 is opaque, 1 - 254 are partially transparent.



Note: To perform a flood alpha fill, use CastAlpha


Demo

Demo  Demos\ImageEditing\EveryMethod\EveryMethod.dpr


Examples

// Set selection as fully transparent
ImageEnView1.Proc.AlphaFill( 0 );


// Set selection as fully opaque
ImageEnView1.Proc.AlphaFill( 255 );


// Set selection as 50% transparent
ImageEnView1.Proc.AlphaFill( 128 );


// Graduate the transparency from fully transparent on the top to fully opaque on the bottom
ImageEnView1.Proc.AlphaFill( 0, 255, gdVertical );




// Gradient fill the alpha channel with fully transparent on the left to fully opaque on the right
ImageEnView1.Proc.AlphaFill( 0, 255, gdHorizontal );





See Also

Fill
GradientFill
SetSelectedAreaAlpha