颜色渐变
var
I:Word;
Y,YStep:Real;
begin
Y:=0;//设置Y方向的初始值
YStep:=ClientHeight/256;//设置步长
for I:=255 downto 0 do
begin
Canvas.Brush.Color:= $00000000+i*$10100;//改变颜色
Canvas.FillRect(Rect(0, Round(Y), ClientWidth, Round(Y+YStep)));
Y:=Y+YStep;
end;
end;
var
I:Word;
Y,YStep:Real;
begin
Y:=0;//设置Y方向的初始值
YStep:=ClientHeight/256;//设置步长
for I:=255 downto 0 do
begin
Canvas.Brush.Color:= $00000000+i*$10100;//改变颜色
Canvas.FillRect(Rect(0, Round(Y), ClientWidth, Round(Y+YStep)));
Y:=Y+YStep;
end;
end;