Changeset 444
- Timestamp:
- Nov 22, 2012, 12:58:18 PM (12 years ago)
- Location:
- GraphicTest
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UDrawForm.lfm
r443 r444 4 4 Top = 208 5 5 Width = 327 6 BorderStyle = bsDialog 6 7 Caption = 'Draw frame' 7 8 FormStyle = fsStayOnTop -
GraphicTest/UMainForm.lfm
r443 r444 24 24 end 25 25 item 26 Caption = ' Duration [ms]'26 Caption = 'Step draw duration [ms]' 27 27 Width = 80 28 28 end … … 32 32 end 33 33 item 34 Caption = ' Step duration [ms]'34 Caption = 'Total step duration [ms]' 35 35 Width = 80 36 36 end … … 107 107 ParentColor = False 108 108 end 109 object SpinEditWidth: TSpinEdit 110 Left = 363 111 Height = 21 112 Top = 411 113 Width = 58 114 Anchors = [akLeft, akBottom] 115 MaxValue = 1000 116 OnChange = SpinEditWidthChange 117 TabOrder = 5 118 Value = 320 119 end 120 object SpinEditHeight: TSpinEdit 121 Left = 432 122 Height = 21 123 Top = 411 124 Width = 58 125 Anchors = [akLeft, akBottom] 126 MaxValue = 1000 127 OnChange = SpinEditHeightChange 128 TabOrder = 6 129 Value = 240 130 end 131 object Label3: TLabel 132 Left = 328 133 Height = 13 134 Top = 416 135 Width = 23 136 Anchors = [akLeft, akBottom] 137 Caption = 'Size:' 138 ParentColor = False 139 end 140 object Label4: TLabel 141 Left = 424 142 Height = 13 143 Top = 415 144 Width = 6 145 Anchors = [akLeft, akBottom] 146 Caption = 'x' 147 ParentColor = False 148 end 109 149 object Timer1: TTimer 110 150 Interval = 500 -
GraphicTest/UMainForm.pas
r443 r444 25 25 Label1: TLabel; 26 26 Label2: TLabel; 27 Label3: TLabel; 28 Label4: TLabel; 27 29 ListViewMethods: TListView; 30 SpinEditWidth: TSpinEdit; 31 SpinEditHeight: TSpinEdit; 28 32 Timer1: TTimer; 29 33 procedure ButtonBenchmarkClick(Sender: TObject); … … 37 41 procedure ListViewMethodsSelectItem(Sender: TObject; Item: TListItem; 38 42 Selected: Boolean); 43 procedure SpinEditHeightChange(Sender: TObject); 44 procedure SpinEditWidthChange(Sender: TObject); 39 45 procedure Timer1Timer(Sender: TObject); 40 46 private … … 42 48 SingleTestActive: Boolean; 43 49 AllTestActive: Boolean; 50 procedure GenerateSceneFrames; 44 51 procedure UpdateMethodList; 45 52 procedure UpdateInterface; 53 procedure UpdateFrameSize; 46 54 public 47 55 FrameSize: TPoint; … … 66 74 procedure TMainForm.FormCreate(Sender: TObject); 67 75 var 68 NewScene: TFastBitmap;69 76 NewDrawMethod: TDrawMethod; 70 77 I: Integer; 71 78 begin 79 Scenes := TObjectList.Create; 80 72 81 FrameSize := Point(320, 240); 73 82 Randomize; 74 Scenes := TObjectList.Create;75 for I := 0 to SceneFrameCount - 1 do begin76 NewScene := TFastBitmap.Create;77 NewScene.Size := FrameSize;78 NewScene.RandomImage;79 Scenes.Add(NewScene);80 end;81 83 82 84 DrawMethods := TObjectList.Create; … … 169 171 procedure TMainForm.FormShow(Sender: TObject); 170 172 begin 173 UpdateFrameSize; 171 174 UpdateMethodList; 172 175 UpdateInterface; … … 196 199 end; 197 200 201 procedure TMainForm.SpinEditHeightChange(Sender: TObject); 202 begin 203 FrameSize.Y := SpinEditHeight.Value; 204 UpdateFrameSize; 205 end; 206 207 procedure TMainForm.SpinEditWidthChange(Sender: TObject); 208 begin 209 FrameSize.X := SpinEditWidth.Value; 210 UpdateFrameSize; 211 end; 212 198 213 procedure TMainForm.Timer1Timer(Sender: TObject); 199 214 begin 200 215 UpdateMethodList; 216 end; 217 218 procedure TMainForm.GenerateSceneFrames; 219 var 220 I: Integer; 221 NewScene: TFastBitmap; 222 begin 223 Scenes.Clear; 224 for I := 0 to SceneFrameCount - 1 do begin 225 NewScene := TFastBitmap.Create; 226 NewScene.Size := FrameSize; 227 NewScene.RandomImage; 228 Scenes.Add(NewScene); 229 end; 201 230 end; 202 231 … … 212 241 ButtonBenchmark.Enabled := not AllTestActive and not SingleTestActive; 213 242 ButtonStop.Enabled := SingleTestActive or AllTestActive; 243 SpinEditWidth.MaxValue := Screen.DesktopWidth; 244 SpinEditHeight.MaxValue := Screen.DesktopHeight; 245 end; 246 247 procedure TMainForm.UpdateFrameSize; 248 begin 249 DrawForm.SetBounds(DrawForm.Left, DrawForm.Top, FrameSize.X, FrameSize.Y); 250 GenerateSceneFrames; 214 251 end; 215 252
Note:
See TracChangeset
for help on using the changeset viewer.