//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent*
Owner)
:
TForm(Owner)
{
CCanvas
= new TControlCanvas;
CCanvas->Control
= TabControl1;
TabControl1->TabHeight
= 40;
}
//--------------------------------------------------------------------------------
void __fastcall
TForm1::FormPaint(TObject *Sender)
{
int
w = Image1->Width;
int
h = Image1->Height;
//here's
where we tile the bitmap
for
(int y = TabControl1->TabHeight; y < Height; y = y + h)
{
for (int x = 0; x < Width; x = x + w)
{
CCanvas->Draw(x, y, Image1->Picture->Bitmap);
}
}
}
//--------------------------------------------------------------------------------
void __fastcall
TForm1::FormClose(TObject *Sender, TCloseAction &Action)
{
delete
CCanvas;
}
|