Hi,
Maybe someone could help me on this, I have tried double buffering but it just doesnt seem to work. Here is some code:
This is simple code that traverses a small image across a larger image
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Main =new Graphics::TBitmap;
Item =new Graphics::TBitmap;
Main->LoadFromFile("main.bmp");
Item->LoadFromFile("blit.bmp");
Image1->Canvas->Draw(0,0,Main);
}
void __fastcall TForm1::ThreadedTimer1Timer(TObject *Sender)
{
X++;
Image1->Canvas->Draw(0,0,Main);
Image1->Canvas->Draw(X,10,Item);
}
The above flickers..
I have tried..
void __fastcall TForm1::ThreadedTimer1Timer(TObject *Sender)
{
X++;
TempBmp->Canvas->Draw(0,0,Main);
TempBmp->Canvas->Draw(X,10,Item);
Image1->Canvas->Draw(X,10,TempBmp);
}
It still flickers....
Any help on this would be greatly appriciated.
Maybe someone could help me on this, I have tried double buffering but it just doesnt seem to work. Here is some code:
This is simple code that traverses a small image across a larger image
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
Main =new Graphics::TBitmap;
Item =new Graphics::TBitmap;
Main->LoadFromFile("main.bmp");
Item->LoadFromFile("blit.bmp");
Image1->Canvas->Draw(0,0,Main);
}
void __fastcall TForm1::ThreadedTimer1Timer(TObject *Sender)
{
X++;
Image1->Canvas->Draw(0,0,Main);
Image1->Canvas->Draw(X,10,Item);
}
The above flickers..
I have tried..
void __fastcall TForm1::ThreadedTimer1Timer(TObject *Sender)
{
X++;
TempBmp->Canvas->Draw(0,0,Main);
TempBmp->Canvas->Draw(X,10,Item);
Image1->Canvas->Draw(X,10,TempBmp);
}
It still flickers....
Any help on this would be greatly appriciated.