垂直交错效果
原理将要显示的图形拆成两部分奇数条扫描线由上往下搬移偶数条扫描线的部分则由下往上搬移而且两者同时进行从屏幕上便可看到分别由上下两端出现的较淡图形向屏幕中央移动直到完全清楚为止
程序算法
procedure TFormButtonClick(Sender: TObject);
var
newbmp:TBitmap;
ijbmpheightbmpwidth:integer;
begin
newbmp:= TBitmapCreate;
newbmpWidth:=imageWidth;
newbmpHeight:=imageHeight;
bmpheight:=imageHeight;
bmpwidth:=imageWidth;
i:=;
while i< =bmpheight do
begin
j:=i;
while j > do
begin
newbmpCanvasCopyRect(Rect(jbmpwidthj)
imageCanvas
Rect(bmpheighti+jbmpwidthbmpheighti+j));
newbmpCanvasCopyRect(Rect
(bmpheightjbmpwidthbmpheightj+)
imageCanvas
Rect(ijbmpwidthij+));
j:=j;
end;
formCanvasDraw(newbmp);
i:=i+;
end;
newbmpfree;
end;
水平交错效果
原理同垂直交错效果原理一样只是将分成两组后的图形分别由左右两端移进屏幕
程序算法
procedure TFormButtonClick(Sender: TObject);
var
newbmp:TBitmap;
ijbmpheightbmpwidth:integer;
begin
newbmp:= TBitmapCreate;
newbmpWidth:=imageWidth;
newbmpHeight:=imageHeight;
bmpheight:=imageHeight;
bmpwidth:=imageWidth;
i:=;
while i< =bmpwidth do
begin
j:=i;
while j > do
begin
newbmpCanvasCopyRect(Rect(jjbmpheight)
imageCanvas
Rect(bmpwidthi+jbmpwidthi+jbmpheight));
newbmpCanvasCopyRect(Rect
(bmpwidthjbmpwidthj+bmpheight)
imageCanvas
Rect(ijij+bmpheight));
j:=j;
end;
formCanvasDraw(newbmp);
i:=i+;
end;
newbmpfree;
end;
[] [] []