home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Books / 4 / EX05.ZIP / PIX_FORM.PAS < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-12-02  |  717 b   |  42 lines

  1. unit Pix_form;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, ExtCtrls, StdCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Panel1: TPanel;
  12.     Button1: TButton;
  13.     procedure Button1Click(Sender: TObject);
  14.   private
  15.     { Private declarations }
  16.   public
  17.     { Public declarations }
  18.   end;
  19.  
  20. var
  21.   Form1: TForm1;
  22.  
  23. implementation
  24.  
  25. {$R *.DFM}
  26.  
  27. procedure TForm1.Button1Click(Sender: TObject);
  28. var
  29.   i, j : Longint;
  30. begin
  31.   Button1.Enabled:=False;
  32.   with Canvas do
  33.     for i:=1 to Width do begin
  34.       Application.ProcessMessages;
  35.       for j:=1 to Height do
  36.         Pixels[i,j]:=i*j;
  37.     end;
  38.   Button1.Enabled:=True;
  39. end;
  40.  
  41. end.
  42.