关于图像显示 - C++ Builder / Windows SDK/API
void thread(LPVOID p)
{
while(1)
{
Graphics::TBitmap* Bmp1=new Graphics::TBitmap;
Graphics::TBitmap* Bmp2=new Graphics::TBitmap;
Bmp1->LoadFromFile("c:\\000.bmp");
Bmp1->PixelFormat=pf24bit;
Bmp2->PixelFormat=pf24bit;
Bmp2->Width=Bmp1->Width;
Bmp2->Height=Bmp1->Height;
// SetStretchBltMode(Bmp1->Canvas->Handle,COLORONCOLOR);
for(int i=0,j=0;i <Bmp1->Height;i+=2)
{
j=i;
while(j>0)
{
::StretchBlt(Bmp2->Canvas->Handle,0,j-1,
Bmp1->Width,1,Bmp1->Canvas->Handle,0,
Bmp1->Height-(i-j-1),Bmp1->Width,1,
SRCCOPY);
::StretchBlt(Bmp2->Canvas->Handle,0,Bmp2->Height-j,
Bmp2->Width,1,Bmp1->Canvas->Handle,0,i-j,Bmp2->Width,1,
SRCCOPY);
j-=2;
}
Form1->Canvas->Draw(0,0,Bmp2);
Sleep(20);
}
Bmp2->Canvas->CopyRect(Rect(0,0,Bmp2->Width,Bmp2->Height),
Bmp1->Canvas,Rect(0,0,Bmp1->Width,Bmp1->Height));
Sleep(10);
delete Bmp1;
delete Bmp2;
}
void __fastcall TForm1::FormCreate(TObject* Sender)
{
_beginthread(thread,0,0);
}
}