1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
void __fastcall TForm1::FormCreate(TObject *Sender)
{
Timer1->Interval=10;
Timer1->Enabled=false;
Path1->WrapMode= TPathWrapMode::Fit;
Path1->Data->Data= "m112.18857,426.24142l1.5583,-218.68064c-0.8441,-27.19303 -25.0763,-42.85435 -25.9204,-59.9896l-8.2852,-113.05759c9.8436,-4.35038 2.2726,-19.12864 0.6494,-24.02443c5.9087,-8.70074 -0.6494,-9.49936 -1.948,-10.86293c-17.7131,-1.62326 -26.0048,-1.36354 -45.4126,0c0,0 -7.3891,6.03857 0,10.38244c1.6882,2.98682 -12.64859,18.9858 0,24.4205l-8.75929,114.13546c-2.5323,19.31043 -22.7128,29.78379 -24.6802,54.80162l1.6233,222.87517c0.044,6.03858 2.5258,11.8369 3.7919,17.75857l103.52259,0c1.2857,-5.90868 3.818,-11.70053 3.8569,-17.75857l0.0033,0z";
Path1->Fill->Kind = TBrushKind::Gradient;
Path1->Fill->Gradient->Style = TGradientStyle::Linear;
Path1->Fill->Gradient->Points->Add();
Path1->Fill->Gradient->Points->Add();
Path1->Fill->Gradient->Points->Points[0]->Color=claWhite ;
Path1->Fill->Gradient->Points->Points[1]->Color=claWhite ;
Path1->Fill->Gradient->Points->Points[0]->Offset=0 ;
Path1->Fill->Gradient->Points->Points[1]->Offset=1 ;
Path1->Fill->Gradient->Points->Points[2]->Color=claBlue ;
Path1->Fill->Gradient->Points->Points[2]->Offset=0.998 ;
Path1->Fill->Gradient->Points->Points[3]->Color=claBlue ;
Path1->Fill->Gradient->Points->Points[3]->Offset=0.999 ;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Timer1Timer(TObject *Sender)
{
Path1->Fill->Gradient->Points->Points[2]->Offset -= 0.01 ;
Path1->Fill->Gradient->Points->Points[3]->Offset -= 0.01 ;
Path1->Repaint();
if(Path1->Fill->Gradient->Points->Points[2]->Offset<=0.1){
Timer1->Enabled=false;
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Timer1->Enabled=true;
} |
Partager