熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Delphi編程 >> 正文

Delphi中的圖形顯示技巧[2]

2022-06-13   來源: Delphi編程 

  垂直交錯效果

  原理將要顯示的圖形拆成兩部分奇數條掃描線由上往下搬移偶數條掃描線的部分則由下往上搬移而且兩者同時進行從屏幕上便可看到分別由上下兩端出現的較淡圖形向屏幕中央移動直到完全清楚為止

  程序算法
  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;

[]  []  []  


From:http://tw.wingwit.com/Article/program/Delphi/201311/25000.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.