LoadUseViewPerspective example for Delphi

Note:

This topic is for Document/Medical only.

This example times the loading of a bitmap with and without changing the internal view perspective.

var
   StartTime, EndTime, DeltaTime: Double;
   RasterIO: LEADRasterIO;
begin
   RasterIO:= CreateComObject(CLASS_LEADRasterIO) as LEADRasterIO;
   //Do not include paints when measuring time.
   LEADRasterView1.AutoRepaint:= False;
   //Time the load using the bitmap//s view perspective.
   RasterIO.LoadUseViewPerspective:= True;
   StartTime:= Time();
   RasterIO.Load (LEADRasterView1.Raster, 'v:\images\bird.tif', 0, 0, 1);
   EndTime:= Time();
   DeltaTime:= EndTime - StartTime;
   ShowMessage(IntToStr(Trunc(DeltaTime)) + ' seconds loaded as is');
   //Time the load that converts the bitmap//s view perspective.
   RasterIO.LoadUseViewPerspective:= False;
   StartTime:= Time();
   RasterIO.Load (LEADRasterView1.Raster, 'v:\images\bird.tif', 0, 0, 1);
   EndTime:= Time();
   DeltaTime:= EndTime - StartTime;
   ShowMessage (IntToStr(Trunc(DeltaTime)) + ' seconds converted on load');
end;