TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
double y, Step = Height / 256.00;
for(int i = 255; i > 0; i--){
Form1->Canvas->Brush->Color = TColor(0x00000000+i*0x10000) ;
Form1->Canvas->FillRect(Rect(0, int(y), Width, int(y+Step)));
y += Step;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormResize(TObject *Sender)
{
Form1->Refresh();
}
//---------------------------------------------------------------------------
实现背景渐变功能
最新推荐文章于 2023-02-16 10:46:45 发布