⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.pas

📁 源码Delphi图像特效显示V1.0版
💻 PAS
📖 第 1 页 / 共 2 页
字号:
   i,bmpheight,bmpwidth:integer;
begin
form1.Repaint;
image1.Visible:=true;
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
for i:=0 to bmpheight do
begin
 newbmp.Canvas.CopyRect(Rect(0,0,bmpwidth,i),
                       image1.Canvas,
                       Rect(0,bmpheight-i,bmpwidth,bmpheight));
 Canvas.Draw(395,109,newbmp);
end;
newbmp.free;
end;

procedure TForm1.N9Click(Sender: TObject);
var
   newbmp: TBitmap;
   i,bmpheight,bmpwidth:integer;
begin
image1.Visible:=true;
form1.Repaint;
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
for i:=0 to bmpheight do
begin
 newbmp.Canvas.CopyRect(Rect(0,bmpheight-i,bmpwidth,bmpheight),
                       image1.Canvas,
                       Rect(0,0,bmpwidth,i));
 Canvas.Draw(395,109,newbmp);
end;
newbmp.free;
end;

procedure TForm1.N10Click(Sender: TObject);
var
   newbmp: TBitmap;
   i,bmpheight,bmpwidth:integer;
begin
image1.Visible:=true;
form1.Repaint;
image1.Visible:=true;
form1.Repaint;
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
for i:=0 to bmpwidth do
begin
 newbmp.Canvas.CopyRect(Rect(0,0,i,bmpheight),
                       image1.Canvas,
                       Rect(bmpwidth-i,0,bmpwidth,bmpheight));
 Canvas.Draw(395,109,newbmp);
end;
newbmp.free;
end;

procedure TForm1.N11Click(Sender: TObject);
var
   newbmp: TBitmap;
   i,bmpheight,bmpwidth:integer;
begin
image1.Visible:=true;
form1.Repaint;
newbmp:= TBitmap.Create;
newbmp.Width:=image1.Width;
newbmp.Height:=image1.Height;
bmpheight:=image1.Height;
bmpwidth:=image1.Width;
for i:=0 to bmpwidth do
begin
 newbmp.Canvas.CopyRect(Rect(bmpwidth-i,0,bmpwidth,bmpheight),
                       image1.Canvas,
                       Rect(0,0,i,bmpheight));
 Canvas.Draw(395,109,newbmp);
end;
newbmp.free;
end;

procedure TForm1.N31Click(Sender: TObject);
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  i:=w div 2;
  j:=h div 2;
  while(i>0) do
  begin
    bitblt(hdc2,i,j,w-2*i,h-2*j,hdc1,i,j,srccopy);
    i:=i-2;
    j:=j-2*h div w;
    sleep(20);
  end;
end;

procedure TForm1.N16Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  k:=0;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  while k<101 do
  begin
    for i:=w downto 0 do
    begin
      bitblt(hdc2,w-(i*k) div 100,0,1,h,hdc1,w-i,0,srccopy);
    end;
    k:=k+1;
  end;
end;

procedure TForm1.N13Click(Sender: TObject);
var i:integer;
begin
  image1.Visible:=true;
form1.Repaint;
  k:=0;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  while k<101 do
  begin
    for i:=0 to h do
    begin
      bitblt(hdc2,0,(i*k) div 100,w,1,hdc1,0,i,srccopy);
    end;
    k:=k+1;
  end;
end;

procedure TForm1.N14Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  k:=0;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  while k<101 do
  begin
    for i:=h downto 0 do
    begin
      bitblt(hdc2,0,h-(i*k) div 100,w,1,hdc1,0,h-i,srccopy);
    end;
    k:=k+1;
  end;
end;

procedure TForm1.N30Click(Sender: TObject);
var
  i,j:integer;
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  for i:=0 to h do
  begin
    for j:=0 to 1 do
    begin
      bitblt(hdc2,0,0,w div 4,i,hdc1,0,h-i,srccopy);
      bitblt(hdc2,w div 4,h-i,w div 4,i,hdc1,w div 4,0,srccopy);
      bitblt(hdc2,w div 2,0,w div 4,i,hdc1,w div 2,w-i,srccopy);
      bitblt(hdc2,3*w div 4,h-i,w div 4,i,hdc1,3*w div 4,0,srccopy);
      sleep(5);
    end;
  end;
end;

procedure TForm1.N24Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  for i:=0 to h do
  begin
    bitblt(hdc2,0,i,w,i,hdc1,0,i,srccopy);
    sleep(10);
  end;
end;

procedure TForm1.N25Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  for i:=0 to h do
  begin
    bitblt(hdc2,0,h-i,w,i,hdc1,0,h-i,srccopy);
    sleep(10);
  end;
end;

procedure TForm1.N26Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  for i:=0 to w do
  begin
    bitblt(hdc2,i,0,i,h,hdc1,i,0,srccopy);
    sleep(10);
  end;
end;

procedure TForm1.N18Click(Sender: TObject);
var i:integer;
begin
image1.Visible:=true;
form1.Repaint;
  paintbox1.Refresh();
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
  for i:=0 to (h div 2)+1 do
  begin
    bitblt(hdc2,0,i,w,1,hdc1,0,i,srccopy);
    bitblt(hdc2,0,h-i,w,h,hdc1,0,h-i,srccopy);
    sleep(10);
  end;
end;

procedure TForm1.N3Click(Sender: TObject);
begin
form2.ShowModal;
end;

procedure TForm1.N49Click(Sender: TObject);
begin
ShellExecute(handle,nil,pchar('help.htm'),nil,nil,sw_shownormal);
end;

procedure TForm1.N42Click(Sender: TObject);
var
i:integer;
begin
  image1.Visible:=false;
 form1.repaint;
  for i:=0 to image1.height do
  begin
    with rect1 do
     begin
       left:=0;
       top:=i;
       right:=image1.width;
       bottom:=i+1;
     end;
    with rect2 do
     begin
      left:=250;
      top:=(form1.height div 2)-i-1;
      right:=250+image1.width;
      bottom:=(form1.height div 2)-i;
     end;
    with rect3 do
     begin
      left:=250;
      top:=(form1.height div 2)+i-1;
      right:=250+image1.width;
      bottom:=(form1.height div 2)+i;
     end;
   canvas.copyrect(rect2,image1.canvas,rect1);
   canvas.copyrect(rect3,image1.canvas,rect1);
  end;
end;

procedure TForm1.N40Click(Sender: TObject);
var
i:integer;
begin
 form1.repaint;
  if image1.Width>0 then
  for i:=0 to image1.Width do
   begin
    bitblt(form1.canvas.handle,123+i,109,i,image1.height,
    image1.canvas.handle,image1.width-i,0,srccopy);
   end;
end;

procedure TForm1.N41Click(Sender: TObject);
var
i:integer;
begin
   image1.Visible:=false;
  form1.repaint;
  for i:=0 to image1.width do
   begin
    with rect1 do
     begin
      left:=i;
      top:=0;
      right:=i+1;
      bottom:=image1.height;
     end;
    with rect2 do
     begin
      left:=(form1.width div 2)-i-1;
      top:=i;
      right:=(form1.width div 2)-i;
      bottom:=image1.height+i;
     end;
    with rect3 do
     begin
      left:=(form1.width div 2)+i-1;
      top:=i;
      right:=(form1.width div 2)+i;
      bottom:=image1.height+i;
     end;
    canvas.copyrect(rect2,image1.canvas,rect1);
    canvas.copyrect(rect3,image1.canvas,rect1);
 end;
end;

procedure TForm1.N38Click(Sender: TObject);
begin
image1.Visible:=true;
form1.Repaint;
image1.canvas.copyRect(Rect(image1.width,image1.height,0,0),image1.canvas,
rect(0,0,image1.width,image1.height));
end;

procedure TForm1.N44Click(Sender: TObject);
var
  i,j:integer;
begin
  image1.Visible:=true;
  form1.Repaint;
  paintbox1.Refresh();
  h:=image1.Height;
  w:=image1.Width;
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
for i:=1 to h do
 for j:=1 to w div 2 do
  begin
   bitblt(hdc2,(w div 2)-(i*j) div h,i,1,1,hdc1,(w div 2)-j,i,srccopy);
   bitblt(hdc2,(w div 2)+(i*j) div h,i,1,1,hdc1,(w div 2)+j,i,srccopy);
  end;
end;

procedure TForm1.N45Click(Sender: TObject);
var
  i,j:integer;
begin
  image1.Visible:=true;
  form1.Repaint;
  paintbox1.Refresh();
  h:=image1.Height;
  w:=image1.Width;
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
for i:=1 to h do
 for j:=w div 2 downto 1 do
  begin
   bitblt(hdc2,(w div 2)-(i*j) div h,h-i,1,1,hdc1,(w div 2)-j,h-i,srccopy);
   bitblt(hdc2,(w div 2)+(i*j) div h,h-i,1,1,hdc1,(w div 2)+j,h-i,srccopy);
  end;
end;

procedure TForm1.N46Click(Sender: TObject);
var
  i,j:integer;
begin
  image1.Visible:=true;
  form1.Repaint;
  paintbox1.Refresh();
  h:=image1.Height;
  w:=image1.Width;
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
for i:=1 to w do
 for j:=1 to h div 2 do
  begin
   bitblt(hdc2,i,(h div 2)-(i*j) div w,1,1,hdc1,i,(h div 2)-j,srccopy);
   bitblt(hdc2,i,(h div 2)+(i*j) div w,1,1,hdc1,i,(h div 2)+j,srccopy);
  end;
end;

procedure TForm1.N47Click(Sender: TObject);
var
  i,j:integer;
begin
  image1.Visible:=true;
  form1.Repaint;
  paintbox1.Refresh();
  h:=image1.Height;
  w:=image1.Width;
  hdc2:=paintbox1.Canvas.Handle;
  hdc1:=image1.Canvas.Handle;
for i:=1 to w do
 for j:=1 to h div 2 do
  begin
   bitblt(hdc2,w-i,(h div 2)-(i*j) div w,1,1,hdc1,w-i,(h div 2)-j,srccopy);
   bitblt(hdc2,w-i,(h div 2)+(i*j) div w,1,1,hdc1,w-i,(h div 2)+j,srccopy);
  end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -