Changeset 97
- Timestamp:
- Jan 23, 2017, 9:59:49 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Back.pas
r86 r97 18 18 procedure FormClose(Sender: TObject; var Action: TCloseAction); 19 19 private 20 img: TBitmap;20 Img: TBitmap; 21 21 end; 22 22 … … 33 33 procedure TBackground.FormCreate(Sender: TObject); 34 34 begin 35 img := nil;35 Img := nil; 36 36 end; 37 37 38 38 procedure TBackground.FormShow(Sender: TObject); 39 39 begin 40 img := nil;40 Img := nil; 41 41 if FullScreen then begin 42 42 if FileExists(HomeDir + 'Graphics' + DirectorySeparator + 'Background.png') then begin 43 img := TBitmap.Create;43 Img := TBitmap.Create; 44 44 LoadGraphicFile(img, HomeDir + 'Graphics' + DirectorySeparator + 'Background.png'); 45 45 end; … … 55 55 procedure TBackground.FormDestroy(Sender: TObject); 56 56 begin 57 // TODO Why FormClose is not executed? 58 if img <> nil then 59 FreeAndNil(img); 57 if Assigned(Img) then FreeAndNil(Img); 60 58 end; 61 59 62 60 procedure TBackground.FormPaint(Sender: TObject); 63 61 begin 64 if img <> nilthen65 BitBlt(Canvas.Handle, Screen.Width - img.Width - (Screen.Width - 800) *66 3 div 8, (Screen.Height - 600) div 3, img.Width, img.Height,67 img.Canvas.Handle, 0, 0, SRCCOPY);62 if Assigned(Img) then 63 BitBlt(Canvas.Handle, Screen.Width - Img.Width - (Screen.Width - 800) * 64 3 div 8, (Screen.Height - 600) div 3, Img.Width, Img.Height, 65 Img.Canvas.Handle, 0, 0, SRCCOPY); 68 66 end; 69 67 70 68 procedure TBackground.FormClose(Sender: TObject; var Action: TCloseAction); 71 69 begin 72 if img <> nil then begin73 img.Free;74 img := nil75 end;76 70 end; 77 71
Note:
See TracChangeset
for help on using the changeset viewer.