Delphi Canvas.Brush为窗体绘制渐变背景.rar
Delphi为窗体绘制渐变背景,这里使用了Delphi中的Canvas.Brush.Color来实现窗口背景的渐变色,不错吧?如示例图的左右渐变效果,实现的代码:
fori:=0toself.Width-1do
begin
c1:=GetRValue(StartColor)Trunc(i*(GetRValue(EndColor)-GetRValue(StartColor))/(self.Width-1));
c2:=GetGValue(StartColor)Trunc(i*(GetGValue(EndColor)-GetGValue(StartColor))/(s
下载地址
用户评论