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
| void __fastcall TForm2::FormCreate(TObject *Sender)
{
h1=1;
h2=3;
wt=300;
h0=(wt-2*h2-2*h1)/3;
wt=2*h2+2*h1+3*h0;
Height=wt+200;
Width=wt+200;
int del=Height-ClientHeight;
Height=wt+del+Button1->Height+20;
del=Width-ClientWidth;
Width=wt+del;
Button2->Left=Width/4-Button2->Width/2;
Button1->Left=Width*3/4-Button1->Width/2;
Button2->Top=Height-Button2->Height-10;
Button1->Top=Height-Button1->Height-10;
Image1->Top=0;
Image1->Left=0;
Form2->Image1->Width=ClientWidth;
Form2->Image1->Height=ClientHeight;
sprintf(message,"image width=%d height=%d mise en couleur",Image1->Width,Image1->Height);
Form1->Memo1->Lines->Add(AnsiString(message));
sprintf(message,"Image top et left %d %d",Image1->Top,Image1->Left);
Form1->Memo1->Lines->Add(AnsiString(message));
Form2->Image1->Canvas->Brush->Color=clRed;
Form2->Image1->Canvas->FillRect(Rect(0,0,Image1->Width,Image1->Height));
} |
Partager