home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 December / Chip_2001-12_cd1.bin / zkuste / delphi / kompon / d23456 / CAJSCRTP.ZIP / demo_del / demo2.pas < prev    next >
Pascal/Delphi Source File  |  2001-04-04  |  795b  |  43 lines

  1. unit demo2;
  2. interface
  3.  
  4. uses
  5.  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  6. ExtCtrls;
  7. type
  8.  TPaintForm = class(TForm)PaintBox1: TPaintBox;
  9.   procedure FormCreate(Sender: TObject);
  10.   procedure FormDestroy(Sender: TObject);
  11.   procedure PaintBox1Paint(Sender: TObject);
  12.   private
  13.  { Private declarations }  public
  14.  Bitmap: TBitmap;
  15.   procedure DoUpdate;
  16. end;
  17. var
  18.  PaintForm: TPaintForm;
  19. implementation
  20.  
  21.  
  22.  
  23. {$R *.dfm}procedure TPaintForm.DoUpdate;
  24. begin
  25.  PaintBox1.Repaint;
  26. end;
  27.  
  28. procedure TPaintForm.FormCreate(Sender: TObject);
  29. begin
  30.  Bitmap := TBitmap.Create;
  31. end;
  32.  
  33. procedure TPaintForm.FormDestroy(Sender: TObject);
  34. begin
  35.  Bitmap.Free;
  36. end;
  37.  
  38. procedure TPaintForm.PaintBox1Paint(Sender: TObject);
  39. begin
  40.  Canvas.Draw(0, 0, Bitmap);
  41. end;
  42. end.
  43.