Changeset 18 for trunk/UMainForm.pas
- Timestamp:
- Sep 27, 2011, 3:49:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMainForm.pas
r16 r18 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils, GraphType; 9 ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils, GraphType, 10 UPersistentForm, UApplicationInfo; 10 11 11 12 type … … 39 40 procedure AShowMapExecute(Sender: TObject); 40 41 procedure AShowRawImageDescExecute(Sender: TObject); 42 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 41 43 procedure FormCreate(Sender: TObject); 42 44 procedure FormDeactivate(Sender: TObject); 45 procedure FormDestroy(Sender: TObject); 43 46 procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); 44 47 procedure FormKeyUp(Sender: TObject; var Key: Word; Shift: TShiftState); … … 55 58 Drawing: Boolean; 56 59 public 57 { public declarations }60 PersistentForm: TPersistentForm; 58 61 end; 59 62 … … 96 99 procedure TMainForm.FormCreate(Sender: TObject); 97 100 begin 101 PersistentForm := TPersistentForm.Create; 102 PersistentForm.RegistryKey := '\Software\' + ApplicationInfo.CompanyName + '\' + ApplicationInfo.Name; 103 98 104 Application.OnDeactivate := FormDeactivate; 99 105 Randomize; … … 138 144 begin 139 145 Engine.KeyBoard.ClearAll; 146 end; 147 148 procedure TMainForm.FormDestroy(Sender: TObject); 149 begin 150 PersistentForm.Free; 140 151 end; 141 152 … … 178 189 179 190 procedure TMainForm.AShowRawImageDescExecute(Sender: TObject); 180 var 181 List: TStringList; 182 begin 183 with Image1.Picture.Bitmap.RawImage, Description do 184 try 185 List := TStringList.Create; 186 with List do begin 187 Add('Format: ' + RawImageColorFormatNames[Format]); 188 Add('Width: ' + IntToStr(Width)); 189 Add('Height: ' + IntToStr(Height)); 190 Add('Depth: ' + IntToStr(Depth)); 191 Add('BitOrder: ' + RawImageBitOrderNames[BitOrder]); 192 Add('ByteOrder: ' + RawImageByteOrderNames[ByteOrder]); 193 Add('LineOrder: ' + RawImageLineOrderNames[LineOrder]); 194 Add('LineEnd: ' + RawImageLineEndNames[LineEnd]); 195 Add('BitsPerPixel: ' + IntToStr(BitsPerPixel)); 196 Add('RedPrec: ' + IntToStr(RedPrec)); 197 Add('RedShift: ' + IntToStr(RedShift)); 198 Add('GreenPrec: ' + IntToStr(GreenPrec)); 199 Add('GreenShift: ' + IntToStr(GreenShift)); 200 Add('BluePrec: ' + IntToStr(BluePrec)); 201 Add('BlueShift: ' + IntToStr(BlueShift)); 202 Add('AlphaPrec: ' + IntToStr(AlphaPrec)); 203 Add('AlphaShift: ' + IntToStr(AlphaShift)); 204 end; 205 ShowMessage(List.Text); 206 finally 207 List.Free; 208 end; 191 begin 192 ShowMessage(Image1.Picture.Bitmap.RawImage.Description.AsString); 193 end; 194 195 procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 196 begin 197 PersistentForm.Save(Self); 209 198 end; 210 199 … … 229 218 procedure TMainForm.FormShow(Sender: TObject); 230 219 begin 220 PersistentForm.Load(Self); 231 221 end; 232 222
Note:
See TracChangeset
for help on using the changeset viewer.