Changeset 15 for trunk/Forms
- Timestamp:
- Dec 27, 2017, 8:28:45 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r14 r15 39 39 procedure Timer1Timer(Sender: TObject); 40 40 private 41 TempBitmap: TBitmap; 41 42 RedrawPending: Boolean; 42 43 VideoDevice: TDeviceVideoBase; … … 73 74 NewApp2: TApp; 74 75 begin 76 TempBitmap := TBitmap.Create; 75 77 PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque]; 76 78 … … 164 166 begin 165 167 FreeAndNil(Kernel); 168 FreeAndNil(TempBitmap); 166 169 end; 167 170 … … 186 189 X, Y: Integer; 187 190 DX, DY: Integer; 188 Bitmap: TBitmap;189 191 P, PR: PByte; 190 192 begin 191 193 try 192 Bitmap := TBitmap.Create; 193 Bitmap.BeginUpdate; 194 Bitmap.SetSize(PaintBox1.Width, PaintBox1.Height); 194 TempBitmap.BeginUpdate; 195 TempBitmap.SetSize(PaintBox1.Width, PaintBox1.Height); 195 196 196 197 if Assigned(VideoDevice.VideoMemory) then begin … … 201 202 PR := P; 202 203 for X := 0 to VideoDevice.VideoMode.Size.X - 1 do begin 203 Bitmap.Canvas.Pixels[X, Y] := PInteger(PR)^ and $ffffff;204 TempBitmap.Canvas.Pixels[X, Y] := PInteger(PR)^ and $ffffff; 204 205 Inc(PR, DX); 205 206 end; … … 208 209 end; 209 210 finally 210 PaintBox1.Canvas.Draw(0, 0, Bitmap); 211 Bitmap.EndUpdate; 212 Bitmap.Free; 211 PaintBox1.Canvas.Draw(0, 0, TempBitmap); 212 TempBitmap.EndUpdate; 213 213 end; 214 214 end;
Note:
See TracChangeset
for help on using the changeset viewer.