ImageEn, unit iexBitmaps

TIEBitmap.AlphaFillRect

TIEBitmap.AlphaFillRect


Declaration

procedure AlphaFillRect(x1, y1, x2, y2: integer; Value: Byte; Scaled: Boolean = False); overload;
procedure AlphaFillRect(x1, y1, x2, y2: integer; StartValue, EndValue: Byte; Direction: TIEGradientDir = gdVertical); overload;
If Scaled = True, then pixels that are already partially transparent will be scaled in the ratio of Value/255.


Description

Sets the transparency of the alpha channel within a rect. Either filling it with a single value, or graduating from one value to another (gradient transparency).

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




Examples

// Set image rect as fully transparent
IEBitmap.AlphaFillRect( 100, 100, 200, 200, 0 );


// Set image rect as fully opaque
IEBitmap.AlphaFillRect( 100, 100, 200, 200, 255 );


// Halve the alpha (Double the transparency) of image rect (fully opaque pixels will become 50%, partially opaque ones will becomes <50%)
IEBitmap.AlphaFill( 100, 100, 200, 200, 128, True );


// Set image rect as 50% transparent
IEBitmap.AlphaFillRect( 100, 100, 200, 200, 128 );


// Graduate the transparency of an image rect from fully transparent on the left to fully opaque on the right
IEBitmap.AlphaFillRect( 100, 100, 200, 200, 0, 255, gdHorizontal );


See Also

 Alpha
 AlphaChannel
 AlphaFill
 Fill
 FillRect
 GradientFill
 GradientFillRect