主题:关于渐变色的
帮我看看有什么问题,为什么执行的是一块一块的,我想让它显示的是蓝色-天蓝色的渐变,
procedure TForm1.FormPaint(Sender: TObject);
var i:integer;
my,y:real;
begin
my:=clientheight/256;
y:=0;
for i:=255 downto 0 do
begin
//canvas.Brush.Color:=$f0caa6+i*$e43;
canvas.Brush.Color:=$0+i*$10000 ;
canvas.FillRect(Rect(0,round(y),clientwidth,round(y+my)));
y:=y+my;
end;
end;
procedure TForm1.FormPaint(Sender: TObject);
var i:integer;
my,y:real;
begin
my:=clientheight/256;
y:=0;
for i:=255 downto 0 do
begin
//canvas.Brush.Color:=$f0caa6+i*$e43;
canvas.Brush.Color:=$0+i*$10000 ;
canvas.FillRect(Rect(0,round(y),clientwidth,round(y+my)));
y:=y+my;
end;
end;