void__fastcall TForm1::Item5Click(TObject *Sender)
{ //圖像從左移入//
Form1->Refresh( );
for(i=Bitmap1->Width;i>=0;i--)
{
Dest1=Rect(0,0,Bitmap1->Width-i,Bitmap1->Height);
Source1=Rect(i,0,Bitmap1->Width,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
8、在Items6的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item6Click(TObject *Sender)
{ //圖像從右移入//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Width;i++)
{
Dest1=Rect(Bitmap1->Width-i,0,Bitmap1->Width,
Bitmap1->Height);
Source1=Rect(0,0,i,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
9、在Items7的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item7Click(TObject *Sender)
{ //圖像從上移入//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Height;i++)
{
Dest1 =Rect(0,0,Bitmap1->Width,i);
Source1 =Rect(0,Bitmap1->Height-i,Bitmap1->Width,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
10、在Items8的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item8Click(TObject *Sender)
{ //圖像從下移入//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Height;i++)
{
Dest1 =Rect(0,Bitmap1->Height-i,Bitmap1->Width,
Bitmap1->Height);
Source1 =Rect(0,0,Bitmap1->Width,i);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
11、在Items9的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item9Click(TObject *Sender)
{ //圖像從左刷屏顯示//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Width;i++)
{
Dest1 =Rect(0,0,i,Bitmap1->Height);
Source1 =Rect(0,0,i,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
12、在Items10的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item10Click(TObject *Sender)
{ //圖像從右刷屏顯示//
Form1->Refresh( );
for(i=Bitmap1->Width;i>=0;i--)
{
Dest1 =Rect(i+0,0,0+Bitmap1->Width,0+Bitmap1->Height);
Source1 =Rect(i,0,Bitmap1->Width,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
13、在Items11的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item11Click(TObject *Sender)
{ //圖像從上刷屏顯示//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Height;i++)
{
Dest1 =Rect(0,0,Bitmap1->Width+0,i+0);
Source1 =Rect(0,0,Bitmap1->Width,i);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
14、在Items12的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item12Click(TObject *Sender)
{ //圖像從下刷屏顯示//
Form1->Refresh( );
for(i=Bitmap1->Height;i>=0;i--)
{
Dest1 =Rect(0,i+0,Bitmap1->Width+0,Bitmap1->Height+0);
Source1 =Rect(0,i,Bitmap1->Width,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
15、在Items13的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item13Click(TObject *Sender)
{ //圖像從上往下流水//
Form1->Refresh( );
for(i=Bitmap1->Height;i>=0;i--)
{
Source1 =Rect(0,i,Bitmap1->Width,i+1);
for(int j1=0;j1<=i;j1++)
{
Dest1 =Rect(0 ,j1,Bitmap1->Width+0,j+1);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
}
16、在Items14的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item14Click(TObject *Sender)
{ //圖像從下往上流水//
Form1->Refresh( );
for(i=0;i<=Bitmap1->Height;i++)
{
Source1 =Rect(0,i,Bitmap1->Width,i+1);
for(int j1=Bitmap1->Height-1;j1>=i;j1--)
{
Dest1 =Rect(0,j1,Bitmap1->Width,j1+1);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
for(j=0;j<10000;j++);
}
}
}
17、在Items15的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item15Click(TObject *Sender)
{ //圖像圓形展出//
Form1->Refresh( );
int j1=sqrt(Bitmap1->Width*Bitmap1->Width+
Bitmap1->Height*Bitmap1->Height)/2+4;
for (i=1;i
{
MyRgn=CreateEllipticRgn(Bitmap1->Width/2-i,
Bitmap1->Height/2-i,
Bitmap1->Width/2+i,
Bitmap1->Height/2+i);
SelectObject(Canvas->Handle,MyRgn);
Canvas->Draw(0,0,Bitmap1);
DeleteObject(MyRgn);
for(j=0;j<10000;j++);
}
}
18、在Items16的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item16Click(TObject *Sender)
{ //圖像左右錯移//
Form1->Refresh( );
HeightHalf=Bitmap1->Height/2+Bitmap1->Height%2;
Source1=Rect(0,0,Bitmap1->Width,HeightHalf);
Source2=Rect(0,HeightHalf,Bitmap1->Width,Bitmap1->Height);
for(i=0;i<=Bitmap1->Width;i++)
{
Dest1=Rect(0-Bitmap1->Width+i,0,i,0+HeightHalf);
Dest2=Rect(Bitmap1->Width-i,HeightHalf,
Bitmap1->Width+Bitmap1->Width-i,
Bitmap1->Height+0);
Form1->Canvas->MoveTo(0-Bitmap1->Width+i-1,0);
Form1->Canvas->LineTo(0-Bitmap1->Width+i-1,HeightHalf);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
Form1->Canvas->MoveTo(
Bitmap1->Width+Bitmap1->Width-i,0);
Form1->Canvas->LineTo(
Bitmap1->Width+Bitmap1->Width-i,Bitmap1->Height);
Form1->Canvas->CopyRect(Dest2,Bitmap1->Canvas,Source2);
for(j=0;j<10000;j++);
}
}
19、在Items17的OnClieck事件中添加如下代碼:
void__fastcall TForm1::Item17Click(TObject *Sender)
{ //圖像上下錯移//
Form1->Refresh( );
WideHalf=Bitmap1->Width/2+Bitmap1->Width%2;
Source1=Rect(0,0,WideHalf,Bitmap1->Height);
Source2=Rect(WideHalf,0,Bitmap1->Width,Bitmap1->Height);
for(i=0;i<=Bitmap1->Height;i++)
{
Dest1=Rect(0,0-Bitmap1->Height+i,WideHalf,0+i);
Dest2=Rect(WideHalf,
Bitmap1->Height-i,
Bitmap1->Width,
Bitmap1->Height+Bitiap1(>Ighdht)k-; &'Biym1->Canvas->MoveTo(0,0-Bitmap1->Height+i-1);
Form1->Canvas->LineTo(WideHalf,
0-Bitmap1->Height+i-1);
Form1->Canvas->CopyRect(Dest1,Bitmap1->Canvas,Source1);
Form1->Canvas->MoveTo(WideHalf,
Bitmap1->Height+Bitmap1->Height-i);
Form1->Canvas->LineTo(Bitmap1->Width,
Bitmap1->Height+Bitmap1->Height-i);
Form1->Canvas->CopyRect(Dest2,Bitmap1->Canvas,Source2);
for(j=0;j<10000;j++);
}
}
以上程序在C++ Builder5.0Enterpriseh和Win98/WinME通過。