Changeset 3 for trunk/Forms/UFormMain.pas
- Timestamp:
- Sep 15, 2014, 11:13:21 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r2 r3 17 17 MenuItem1: TMenuItem; 18 18 MenuItem2: TMenuItem; 19 MenuItem3: TMenuItem; 20 MenuItem4: TMenuItem; 21 MenuItem5: TMenuItem; 19 22 PaintBox1: TPaintBox; 23 Timer1: TTimer; 20 24 procedure PaintBox1Paint(Sender: TObject); 21 25 procedure PaintBox1Resize(Sender: TObject); 26 procedure Timer1Timer(Sender: TObject); 22 27 private 23 28 { private declarations } 24 29 public 25 { public declarations }30 procedure Redraw; 26 31 end; 27 32 … … 43 48 end; 44 49 50 procedure TFormMain.Timer1Timer(Sender: TObject); 51 var 52 Bitmap: TBitmap; 53 begin 54 Timer1.Enabled := False; 55 try 56 Bitmap := TBitmap.Create; 57 Bitmap.SetSize(Core.Project.Bitmap.Size.X, Core.Project.Bitmap.Size.Y); 58 Bitmap.BeginUpdate(True); 59 Core.Project.Bitmap.PaintToCanvas(Bitmap.Canvas); 60 Bitmap.EndUpdate(False); 61 PaintBox1.Canvas.Draw(0, 0, Bitmap); 62 finally 63 Bitmap.Free; 64 end; 65 end; 66 67 procedure TFormMain.Redraw; 68 begin 69 Timer1.Enabled := True; 70 end; 71 45 72 procedure TFormMain.PaintBox1Paint(Sender: TObject); 46 73 begin 47 Core.Project.Bitmap.PaintToCanvas(PaintBox1.Canvas);74 Redraw; 48 75 end; 49 76
Note:
See TracChangeset
for help on using the changeset viewer.