delphi怎么实现界面的渐变?
我有这样一段代码,不知怎么调不过(我是很菜)建成一表单,width=500,设置 Button1其Click代码:
procedure TForm1.Button1Click(Sender:TObject);
var i,j:Integer
Dct:TRect
begin
j:=From1.height
for i:=0 to 255 do
begin
Canvas.Brush.Color:=RGB(255,255,i)
Dct:=Rect(i*2,0,(i+1)*2,j)
Canvas.FillRect(Dct)
end;
end;