我想在界面上做个显示图片的功能,当鼠标点的时候,图片换成另一张,并且以类似百叶窗的形式显示,如何做?(50分)

  • 主题发起人 主题发起人 SevenOrient
  • 开始时间 开始时间
S

SevenOrient

Unregistered / Unconfirmed
GUEST, unregistred user!
如题目,谢谢回答~~~
 
我有本书上有例子,不过太长了,明天再说吧
 
有个picshow的控件

支持120种效果
 
可以在www.playicq.com
里搜索:picshow
找到
 
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;

type
TForm1 = class(TForm)
Image1: TImage;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Button4: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Button4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
newbmp:Tbitmap;
i,bmpheight,bmpwidth:integer;
begin
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));
Form1.Canvas.Draw(0,0,newbmp);
end;
newbmp.free;
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button3Click(Sender: TObject);
var
newbmp:TBitmap;
j,i,bmpheight,bmpwidth:integer;
begin
newbmp:=TBitmap.Create;
newbmp.Width :=image1.Width ;
newbmp.Height :=image1.Height ;
bmpheight:=image1.Height ;
bmpwidth:=image1.Width ;
for i:=bmpheight downto 1 do
for j:=1 to i do
begin
newbmp.Canvas.CopyRect (Rect(0,j-1,bmpwidth,j),image1.Canvas,Rect(0,i-1,bmpwidth,i));
form1.Canvas.Draw(0,0,newbmp);
end;
newbmp.free;
end;

//百叶窗效果
procedure TForm1.Button4Click(Sender: TObject);
var
newbmp:TBitmap;
i,j,bmpheight,bmpwidth:integer;
xgroup,xcount:integer;
begin
newbmp:=TBitmap.Create;
newbmp.width:=image1.width;
newbmp.Height :=image1.height;
bmpheight:=image1.Height ;
bmpwidth:=image1.width;
xgroup:=16;
xcount:=bmpheight div xgroup;
for i:=0 to xcount do
for j:=0 to xgroup do
begin
newbmp.Canvas.copyRect(Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i),image1.Canvas,Rect(0,xcount*j+i-1,bmpwidth,xcount*j+i));
form1.Canvas.Draw(0,0,newbmp);
end;
newbmp.free;

end;

end.
 
使用ABC控件
 
picshow
带的Demo里,好像少个Unit.调试总是不成功。
 
用用看fxtools看看,代码很小,也起来也方便。
 
希望代码能少一点的
 
fxtools好像要注册的吧?
 
就 PicSHow呵
可以用的
你可以到其它去下个好的嘛
 
多人接受答案了。
 

Similar threads

D
回复
0
查看
2K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
1K
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
后退
顶部