LoadUseViewPerspective example for Delphi
Note: |
This topic is for Document/Medical editions only. |
This example times the loading of a bitmap with and without changing the internal view perspective.
procedure TForm1.TestBtnClick(Sender: TObject);
var
{ Declare local variables }
StartTime, DeltaTime: TDateTime;
Hour, Min, Sec, MSec: Word;
begin
{ Do not include paints when measuring time. }
Lead1.AutoRepaint := False;
{ Time the load using the bitmap's view perspective. }
Lead1.LoadUseViewPerspective := True;
StartTime := Now;
Lead1.Load ('d:\lead\images\rotated.tif', 0, 0, 1);
DeltaTime := Now - StartTime;
DecodeTime(DeltaTime, Hour, Min, Sec, MSec);
ShowMessage('As is, rotated: ' + IntToStr(Sec) + ' seconds + ' +IntToStr(MSec) + ' milliseconds');
{ Time the load that converts the bitmap's view perspective. }
Lead1.LoadUseViewPerspective := False;
StartTime := Now;
Lead1.Load ('d:\lead\images\rotated.tif', 0, 0, 1);
DeltaTime := Now - StartTime;
DecodeTime(DeltaTime, Hour, Min, Sec, MSec);
ShowMessage('Converted to top left: ' + IntToStr(Sec) + ' seconds + ' +IntToStr(MSec) + ' milliseconds');
end;