//--------------------------------------------------------------------------- #include #pragma hdrstop #include "TestPattern.h" #include "Menu3D_F.h" //--------------------------------------------------------------------------- #pragma package(smart_init) #pragma link "TPStretchImage" #pragma resource "*.dfm" TTestForm *TestForm; //--------------------------------------------------------------------------- __fastcall TTestForm::TTestForm(TComponent* Owner) : TForm(Owner) { } //--------------------------------------------------------------------------- void __fastcall TTestForm::Copy(TTexpiaBitmap *src) { HDC shDC = NULL, dhDC = NULL; Image->Width = src->Width; Image->Height = src->Height; if (temp) delete temp; temp = new TTexpiaBitmap; temp->Create(src->Width, src->Height, 24); shDC = src->CreateDC(); dhDC = temp->CreateDC(); BitBlt(dhDC, 0, 0, temp->Width, temp->Height, shDC, 0, 0, SRCCOPY); src->DeleteDC(shDC); temp->DeleteDC(dhDC); Image->Bitmap = temp; Image->Repaint(); } //--------------------------------------------------------------------------- void __fastcall TTestForm::FormCreate(TObject *Sender) { temp = NULL; } //--------------------------------------------------------------------------- void __fastcall TTestForm::FormDestroy(TObject *Sender) { if (temp) delete temp; } //---------------------------------------------------------------------------