📄 mainform.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Mainform.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn1Click(TObject *Sender)
{ //以垂直百叶窗方式显示图像
this->Refresh();
Graphics::TBitmap *pBmp=new Graphics::TBitmap;
pBmp->LoadFromFile("Show.bmp");
int iWidth=this->Width/20;
for(int i=0;i<=iWidth;i++)
{
for(int j=0;j<=20;j++)
{
TRect MyRect=TRect(j*iWidth,0,j*iWidth+i,Height);
Form1->Canvas->CopyMode=cmSrcCopy;
Form1->Canvas->CopyRect(MyRect,pBmp->Canvas,MyRect);
}
Sleep(100);
}
delete pBmp;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::BitBtn2Click(TObject *Sender)
{ //以水平百叶窗方式显示图像
this->Refresh();
Graphics::TBitmap *pBmp=new Graphics::TBitmap;
pBmp->LoadFromFile("Show.bmp");
int iHeight=this->Height/20;
for(int i=0;i<=iHeight;i++)
{
for(int j=0;j<=20;j++)
{
TRect MyRect=TRect(0,j*iHeight,Width,j*iHeight+i);
Form1->Canvas->CopyMode=cmSrcCopy;
Form1->Canvas->CopyRect(MyRect,pBmp->Canvas,MyRect);
}
Sleep(100);
}
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -