LoadUseViewPerspective example for C++ Builder
Note: |
This topic is for Document/Medical only. |
This example times the loading of a bitmap with and without changing the internal view perspective.
double StartTime, EndTime, DeltaTime;
LEADRasterIO* pRasterIO= NULL;
CoCreateInstance(CLSID_LEADRasterIO, NULL, CLSCTX_ALL, IID_ILEADRasterIO, (void**)&pRasterIO);
//Do not include paints when measuring time.
LEADRasterView1->AutoRepaint = False;
//Time the load using the bitmap//s view perspective
pRasterIO->LoadUseViewPerspective = True;
StartTime= Time();
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\bird.tif"), 0, 0, 1);
EndTime= Time();
DeltaTime= EndTime - StartTime;
ShowMessage(IntToStr((int)DeltaTime) + " seconds loaded as is");
//Time the load that converts the bitmap//s view perspective
pRasterIO->LoadUseViewPerspective= False;
StartTime= Time();
pRasterIO->Load (LEADRasterView1->Raster, AnsiToOLESTR("v:\\images\\bird.tif"), 0, 0, 1);
EndTime= Time();
DeltaTime= EndTime - StartTime;
ShowMessage (IntToStr((int)DeltaTime) + " seconds converted on load");
pRasterIO-> Release( );