请提供一下图像显示特效! (100分)

  • 主题发起人 主题发起人 liangzi2222
  • 开始时间 开始时间
L

liangzi2222

Unregistered / Unconfirmed
GUEST, unregistred user!
希望能提供一些比较实用的效果。
 
excel文件相当于一个数据库表,可用ODBC连接后访问,然后再加工导入SQL数据库!
 
我也知道是这么做,可不可以给个小实例呢。
 
看看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.
 
去www.Playicq.com下载picshow 2.82版本,127种显示效果,足够用了。
 
它的源码看起来有些吃力,当然想要自己能看懂的啦!!希望不吝赐教。
 
底片效果
InvertRect(Image2.Canvas.Handle, Image2.Canvas.ClipRect);
Image2.Picture.Bitmap.Assign(Image2.Picture.Bitmap);

淡入淡出
procedure TMainForm.BitBtn41Click(Sender: TObject);
procedure FadeOut(const BMP:TImage;Pause: Integer);
var
BytesPorScan: Integer;
w,h: Integer;
p: pByteArray;
counter: Integer;
begin
{这仅仅适用于24或32位位图}
if not (BMP.Picture.Bitmap.PixelFormat in [pf24Bit, pf32Bit])
then begin
MInfo.Lines.Add('错误,位图格式不支持。');
Exit;
end;
try
BytesPorScan:=Abs(Integer(BMP.Picture.Bitmap.ScanLine[1])-Integer(BMP.Picture.Bitmap.ScanLine[0]));
except
raise Exception.Create('有错误!');
end;
{减少每一个像素的RGB分量}
for counter:=1 to 256 do begin
for h:=0 to BMP.Picture.Bitmap.Height-1 do begin
P:=BMP.Picture.Bitmap.ScanLine[h];
for w:=0 to BytesPorScan-1 do if P^[w]>0 then P^[w]:=P^[w]-1;
end;
Sleep(Pause);
BMP.Refresh;
end;
end;
begin
FadeOut(Image2,5);
end;

 
多人接受答案了。
 
后退
顶部