ImageEn, unit iexBitmaps

TIEBitmap.GradientFill

TIEBitmap.GradientFill


Declaration

procedure GradientFill(StartValue, EndValue: Double; Direction: TIEGradientDir = gdVertical);


Description

Fill the image with a color gradient.
Pixel Format Values
ie1g Specify either 0 or 1
ie8g, ie8p Specify value between 0 and 255
ie16g Specify value between 0 and 65535
ie24RGB, ie32RGB, ie48RGB, ieCMYK, ieCIELab Specify TColor


Examples

// Fill selection with a yellow to red vertical gradient
ImageEnView1.Proc.GradientFill( clYellow, clRed, gdVertical );




// Add a mask filled with a grayscale gradient
var
  prevLayer: TIELayer;
  bmp: TIEBitmap;
begin
  // Create a gradient image with pixel format of ie8g
  bmp := TIEBitmap.Create( 200, 200, ie8g );
  bmp.GradientFill( 1, 255, gdVertical );

  ImageEnView1.LayersInsert( ImageEnView1.LayersCurrent + 1, bmp );

  // Set this layer as a mask
  ImageEnView1.CurrentLayer.IsMask := True;

  // Layer must be hidden to work as mask
  ImageEnView1.CurrentLayer.Visible := False;

  // Make it the cover the underlying image
  prevLayer := ImageEnView1.Layers[ ImageEnView1.LayersCurrent - 1];
  ImageEnView1.CurrentLayer.PosX   := prevLayer.PosX;
  ImageEnView1.CurrentLayer.PosY   := prevLayer.PosY;
  ImageEnView1.CurrentLayer.Width  := prevLayer.Width;
  ImageEnView1.CurrentLayer.Height := prevLayer.Height;

  bmp.Free;
end;




See Also

Fill
FillRect
GradientFillRect
AlphaFill
AlphaFillRect
GradientFillRect