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

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