Changeset 3 for trunk/Forms
- Timestamp:
- Sep 15, 2014, 11:13:21 PM (10 years ago)
- Location:
- trunk/Forms
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r2 r3 23 23 object MenuItem1: TMenuItem 24 24 Caption = 'Soubor' 25 object MenuItem3: TMenuItem 26 Action = Core.AProjectNew 27 end 25 28 object MenuItem2: TMenuItem 26 Action = Core.AProjectNew 29 Action = Core.AExit 30 end 31 end 32 object MenuItem4: TMenuItem 33 Caption = 'Image' 34 object MenuItem5: TMenuItem 35 Action = Core.AImageClear 27 36 end 28 37 end 29 38 end 39 object Timer1: TTimer 40 Enabled = False 41 Interval = 50 42 OnTimer = Timer1Timer 43 left = 195 44 top = 206 45 end 30 46 end -
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.