用Delphi进行渐变色编程(等间距方法,和自然分类)
用Delphi进行渐变色编程(等间距方法,和自然分类这两种方法)我需要代码
答案:procedure TForm1.FormPaint(Sender: TObject);
var
i:word;
dy,y:real;
begin
dy:=clientheight/256;
y:=0;
for i:=255 downto 0 do
begin
canvas.Brush.Color:=$00000000+i*$10000;
canvas.FillRect(rect(0,round(y),clientwidth,round(y+dy)));
y:=y+dy;
end;
end;