Uac.pas
上传用户:jiete_yjc
上传日期:2010-02-11
资源大小:422k
文件大小:2k
源码类别:

医药行业

开发平台:

Delphi

  1. unit Uac;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, ExtCtrls, StdCtrls, ElCLabel, ElURLLabel, Buttons;
  6. type
  7.   Tfac = class(TForm)
  8.     Image1: TImage;
  9.     Button1: TButton;
  10.     Label1: TLabel;
  11.     Label2: TLabel;
  12.     Label3: TLabel;
  13.     ElURLLabel1: TElURLLabel;
  14.     BitBtn1: TBitBtn;
  15.     Label4: TLabel;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure FormKeyDown(Sender: TObject; var Key: Word;
  18.       Shift: TShiftState);
  19.     procedure FormClose(Sender: TObject; var Action: TCloseAction);
  20.     procedure BitBtn1Click(Sender: TObject);
  21.     procedure FormActivate(Sender: TObject);
  22.   private
  23.     { Private declarations }
  24.   public
  25.     { Public declarations }
  26.   end;
  27. var
  28.   fac: Tfac;
  29. implementation
  30. {$R *.dfm}
  31. procedure Tfac.Button1Click(Sender: TObject);
  32. var
  33. newbmp:tbitmap;
  34. i,j,bmpheight,bmpwidth:integer;
  35. begin
  36. newbmp:= tbitmap.create;
  37. newbmp.width:=image1.width;
  38. newbmp.height:=image1.height;
  39. bmpheight:=image1.height;
  40. bmpwidth:=image1.width;
  41. i:=0;
  42. while i<=bmpwidth do
  43. begin
  44. j:=i;
  45. while j >0 do
  46. begin
  47.   newbmp.canvas.copyrect(rect(j-1,0,j,bmpheight),
  48.   image1.canvas,
  49.   rect(bmpwidth-i+j-1,0,bmpwidth-i+j,bmpheight));
  50.   newbmp.canvas.copyrect(rect
  51.   (bmpwidth-j,0,bmpwidth-j+1,bmpheight),
  52.   image1.canvas,
  53.   rect(i-j,0,i-j+1,bmpheight));
  54.   j:=j-2;
  55. end;
  56. canvas.draw(2,10,newbmp);
  57. i:=i+2;
  58. ;
  59. end;
  60. newbmp.free;
  61. end;
  62. procedure Tfac.FormKeyDown(Sender: TObject; var Key: Word;
  63.   Shift: TShiftState);
  64. begin
  65. button1.Click;
  66. end;
  67. procedure Tfac.FormClose(Sender: TObject; var Action: TCloseAction);
  68. begin
  69. action:=cafree;
  70. end;
  71. procedure Tfac.BitBtn1Click(Sender: TObject);
  72. begin
  73. close;
  74. end;
  75. procedure Tfac.FormActivate(Sender: TObject);
  76. begin
  77. BUTTON1.Click;
  78. end;
  79. end.